commit f47354cd4974ae991626ae18948ef61a0a453fd9 Author: geek Date: Tue Apr 24 21:20:01 2018 +0900 ing diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..981da4d --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/dist-server +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +# System Files +.DS_Store +Thumbs.db + +yarn.lock \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..f5bfff3 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "commons-typescript", + "version": "0.0.1", + "license": "COMMERCIAL", + "private": true, + "dependencies": { + + }, + "devDependencies": { + + } +} diff --git a/src/model/alert/Alert.ts b/src/model/alert/Alert.ts new file mode 100644 index 0000000..5b4527a --- /dev/null +++ b/src/model/alert/Alert.ts @@ -0,0 +1,5 @@ +export interface Alert { + created: string; + msg: string; + +} \ No newline at end of file diff --git a/src/model/alert/AlertMetric.ts b/src/model/alert/AlertMetric.ts new file mode 100644 index 0000000..0b6925f --- /dev/null +++ b/src/model/alert/AlertMetric.ts @@ -0,0 +1,5 @@ +import {Alert} from './Alert'; + +export interface AlertMetric extends Alert { + status: string; + } diff --git a/src/model/alert/AlertSystem.ts b/src/model/alert/AlertSystem.ts new file mode 100644 index 0000000..933e283 --- /dev/null +++ b/src/model/alert/AlertSystem.ts @@ -0,0 +1,6 @@ +import {Alert} from './Alert'; + + +export interface AlertSystem extends Alert { + status?: string; // test + } diff --git a/src/model/alert/index.ts b/src/model/alert/index.ts new file mode 100644 index 0000000..b242f4e --- /dev/null +++ b/src/model/alert/index.ts @@ -0,0 +1,3 @@ +export * from './Alert'; +export * from './AlertMetric'; +export * from './AlertSystem'; diff --git a/src/model/discovery/DiscoveryHost.ts b/src/model/discovery/DiscoveryHost.ts new file mode 100644 index 0000000..a1dc3e4 --- /dev/null +++ b/src/model/discovery/DiscoveryHost.ts @@ -0,0 +1,10 @@ +import { DiscoveryPort } from './DiscoveryPort'; + +export interface DiscoveryHost { + firstScanRange?: string; + lastScanRange?: string; + excludeHosts?: string[]; + includeHosts?: string[]; + + discoveryPort?: DiscoveryPort; +} diff --git a/src/model/discovery/DiscoveryPort.ts b/src/model/discovery/DiscoveryPort.ts new file mode 100644 index 0000000..90f5e79 --- /dev/null +++ b/src/model/discovery/DiscoveryPort.ts @@ -0,0 +1,11 @@ +import { DiscoveryService } from './DiscoveryService'; + +export interface DiscoveryPort { + firstScanRange: number; + lastScanRange: number; + excludePorts: number[]; + includeTCP: boolean; + includeUDP: boolean; + + discoveryService?: DiscoveryService; +} diff --git a/src/model/discovery/DiscoveryService.ts b/src/model/discovery/DiscoveryService.ts new file mode 100644 index 0000000..96ffe70 --- /dev/null +++ b/src/model/discovery/DiscoveryService.ts @@ -0,0 +1,3 @@ +export interface DiscoveryService { + includeServices: string[]; +} diff --git a/src/model/discovery/DiscoveryStartInfo.ts b/src/model/discovery/DiscoveryStartInfo.ts new file mode 100644 index 0000000..c294137 --- /dev/null +++ b/src/model/discovery/DiscoveryStartInfo.ts @@ -0,0 +1,11 @@ + +export interface DiscoveryStartInfo { + startIp: string; + endIP: string; + excludeIp?: string; + startPort?: string; + endPort?: string; + services?: Array; +} + +// export default DiscoveryStartInfo; diff --git a/src/model/discovery/DiscoveryZone.ts b/src/model/discovery/DiscoveryZone.ts new file mode 100644 index 0000000..7a17f6a --- /dev/null +++ b/src/model/discovery/DiscoveryZone.ts @@ -0,0 +1,7 @@ +import { DiscoveryHost } from './DiscoveryHost'; + +export interface DiscoveryZone { + excludePatterns?: string[]; + + discoveryHost?: DiscoveryHost; +} diff --git a/src/model/discovery/Host.ts b/src/model/discovery/Host.ts new file mode 100644 index 0000000..15f72df --- /dev/null +++ b/src/model/discovery/Host.ts @@ -0,0 +1,15 @@ +import { Zone } from './Zone'; +import { Port } from './Port'; + +export interface Host { + id?: number; + ip: string; + mac: number; + os: string; + discoveredDate?: Date; + zone?: Zone; + target?: boolean; + + ports: Map | null; + portList: Port[] | null; +} diff --git a/src/model/discovery/Port.ts b/src/model/discovery/Port.ts new file mode 100644 index 0000000..a30a1dc --- /dev/null +++ b/src/model/discovery/Port.ts @@ -0,0 +1,15 @@ +import { Host } from './Host'; +import { PortType } from './PortType'; +import { Service } from './Service'; + +export interface Port { + id?: number; + portType: PortType; + portNumber: number; + discoveredDate?: Date; + host: Host; + target?: boolean; + + services: Map | null; + serviceList: Service[] | null; +} diff --git a/src/model/discovery/PortType.ts b/src/model/discovery/PortType.ts new file mode 100644 index 0000000..6b864bf --- /dev/null +++ b/src/model/discovery/PortType.ts @@ -0,0 +1,8 @@ + +// enum PortType { +// TCP = 1, +// UDP = 2, +// TLS = 3, +// } + +export type PortType = 'TCP' | 'UDP' | 'TLS'; diff --git a/src/model/discovery/Service.ts b/src/model/discovery/Service.ts new file mode 100644 index 0000000..a7f9cd4 --- /dev/null +++ b/src/model/discovery/Service.ts @@ -0,0 +1,10 @@ +import { Port } from './Port'; + +export interface Service { + id: number; + cryptoType: string; + serviceName: string; + discoveredDate?: Date; + port: Port; + target?: boolean; +} diff --git a/src/model/discovery/Zone.ts b/src/model/discovery/Zone.ts new file mode 100644 index 0000000..6eaa24b --- /dev/null +++ b/src/model/discovery/Zone.ts @@ -0,0 +1,12 @@ +import { Host } from './Host'; + +export interface Zone { + id?: number; + network?: string; + ip?: string; + iface?: string; + mac?: string; + discoveredDate?: Date; + + hosts: Map | null; +} diff --git a/src/model/discovery/index.ts b/src/model/discovery/index.ts new file mode 100644 index 0000000..c2583d5 --- /dev/null +++ b/src/model/discovery/index.ts @@ -0,0 +1,11 @@ +export * from './DiscoveryHost'; +export * from './DiscoveryPort'; +export * from './DiscoveryService'; +export * from './DiscoveryZone'; +export * from './DiscoveryStartInfo'; +export * from './Host'; +export * from './Port'; +export * from './PortType'; +export * from './Service'; +export * from './Zone'; + diff --git a/src/model/domain/Domain.ts b/src/model/domain/Domain.ts new file mode 100644 index 0000000..8571aa4 --- /dev/null +++ b/src/model/domain/Domain.ts @@ -0,0 +1,5 @@ +export interface Domain { + id?: number; + name?: string; + createDate?: Date; +} diff --git a/src/model/domain/DomainMember.ts b/src/model/domain/DomainMember.ts new file mode 100644 index 0000000..ab07b7b --- /dev/null +++ b/src/model/domain/DomainMember.ts @@ -0,0 +1,9 @@ +import { Domain } from './Domain'; +import { Member } from 'model/member'; + +export interface DomainMember { + id: number; + createDate: Date; + member: Member; + domain: Domain; +} diff --git a/src/model/domain/index.ts b/src/model/domain/index.ts new file mode 100644 index 0000000..9b2b1d6 --- /dev/null +++ b/src/model/domain/index.ts @@ -0,0 +1,2 @@ +export * from './Domain'; +export * from './DomainMember'; diff --git a/src/model/infra/Infra.ts b/src/model/infra/Infra.ts new file mode 100644 index 0000000..ef7baf2 --- /dev/null +++ b/src/model/infra/Infra.ts @@ -0,0 +1,13 @@ + +import { Probe } from 'model/probe'; +import { Target } from 'model/target'; +import { MetaInfraType } from 'model/meta/infra-type/MetaInfraType'; + +export interface Infra { + id?: number; + infraType?: MetaInfraType; + childId?: number; + createDate?: Date; + probe?: Probe; + target?: Target; +} diff --git a/src/model/infra/InfraHost.ts b/src/model/infra/InfraHost.ts new file mode 100644 index 0000000..272fad7 --- /dev/null +++ b/src/model/infra/InfraHost.ts @@ -0,0 +1,10 @@ +import { InfraOS } from './InfraOS'; +import { Infra } from './Infra'; + +export interface InfraHost extends Infra { + // id?: number; + os?: InfraOS; + ip?: number; + mac?: number; + createDate?: Date; +} diff --git a/src/model/infra/InfraMachine.ts b/src/model/infra/InfraMachine.ts new file mode 100644 index 0000000..c12fc7c --- /dev/null +++ b/src/model/infra/InfraMachine.ts @@ -0,0 +1,8 @@ + +import { Infra } from './Infra'; + +export interface InfraMachine extends Infra { + // id?: number; + meta?: string; + createDate?: Date; +} diff --git a/src/model/infra/InfraOS.ts b/src/model/infra/InfraOS.ts new file mode 100644 index 0000000..3f75f51 --- /dev/null +++ b/src/model/infra/InfraOS.ts @@ -0,0 +1,11 @@ +import { InfraMachine } from './InfraMachine'; +import { Infra } from './Infra'; +import { MetaInfraVendor } from 'model/meta/infra-vendor/MetaInfraVendor'; + +export interface InfraOS extends Infra { + // id?: number; + machine?: InfraMachine; + meta?: string; + createDate?: Date; + vendor?: MetaInfraVendor; +} diff --git a/src/model/infra/InfraOSApplication.ts b/src/model/infra/InfraOSApplication.ts new file mode 100644 index 0000000..40a5a2a --- /dev/null +++ b/src/model/infra/InfraOSApplication.ts @@ -0,0 +1,10 @@ + +import { InfraOS } from './InfraOS'; +import { Infra } from './Infra'; + +export interface InfraOSApplication extends Infra { + // id?: number; + os?: InfraOS; + name?: string; + createDate?: Date; +} diff --git a/src/model/infra/InfraOSDaemon.ts b/src/model/infra/InfraOSDaemon.ts new file mode 100644 index 0000000..8e4eeb8 --- /dev/null +++ b/src/model/infra/InfraOSDaemon.ts @@ -0,0 +1,9 @@ +import { InfraOS } from './InfraOS'; +import { Infra } from './Infra'; + +export interface InfraOSDaemon extends Infra { + // id?: number; + os?: InfraOS; + name?: string; + createDate?: Date; +} diff --git a/src/model/infra/InfraOSPort.ts b/src/model/infra/InfraOSPort.ts new file mode 100644 index 0000000..ea982f7 --- /dev/null +++ b/src/model/infra/InfraOSPort.ts @@ -0,0 +1,13 @@ +import { InfraOS } from './InfraOS'; +import { Infra } from './Infra'; +import { MetaInfraVendor } from 'model/meta/infra-vendor/MetaInfraVendor'; + +export interface InfraOSPort extends Infra { + // id?: number; + os?: InfraOS; + createDate?: Date; + port?: number; + portType?: string; + vendor?: MetaInfraVendor; + tlsType?: boolean; +} diff --git a/src/model/infra/InfraService.ts b/src/model/infra/InfraService.ts new file mode 100644 index 0000000..84364bb --- /dev/null +++ b/src/model/infra/InfraService.ts @@ -0,0 +1,13 @@ +import { InfraHost } from './InfraHost'; +import { Infra } from './Infra'; +import { MetaInfraVendor } from 'model/meta/infra-vendor/MetaInfraVendor'; + +export interface InfraService extends Infra { + // id?: number; + host?: InfraHost; + portType?: string; + port?: number; + vendor?: MetaInfraVendor; + createDate?: Date; + tlsType?: boolean; +} diff --git a/src/model/infra/index.ts b/src/model/infra/index.ts new file mode 100644 index 0000000..11a43d5 --- /dev/null +++ b/src/model/infra/index.ts @@ -0,0 +1,8 @@ +export * from './InfraHost'; +export * from './InfraMachine'; +export * from './InfraOSApplication'; +export * from './InfraOSDaemon'; +export * from './InfraOSPort'; +export * from './InfraOS'; +export * from './InfraService'; +export * from './Infra'; diff --git a/src/model/member/Member.ts b/src/model/member/Member.ts new file mode 100644 index 0000000..fb0971b --- /dev/null +++ b/src/model/member/Member.ts @@ -0,0 +1,13 @@ +import { MetaMemberStatus } from 'model/meta/member-status/MetaMemberStatus'; + +export interface Member { + id?: number; + email?: string; + password?: string; + name?: string; + phone?: string; + companyName?: string; + createDate?: Date; + totpType?: boolean; + status?: MetaMemberStatus; +} diff --git a/src/model/member/MemberStatus.ts b/src/model/member/MemberStatus.ts new file mode 100644 index 0000000..a8ddc37 --- /dev/null +++ b/src/model/member/MemberStatus.ts @@ -0,0 +1,6 @@ +export enum MemberStatus { + NOAUTH = 1, + NORMAL = 2, + DORMANCY = 3, + WITHDRAWAL = 4, +} diff --git a/src/model/member/MemberTotp.ts b/src/model/member/MemberTotp.ts new file mode 100644 index 0000000..17fd054 --- /dev/null +++ b/src/model/member/MemberTotp.ts @@ -0,0 +1,10 @@ +import { Member } from 'model/member'; + +export interface MemberTotp { + id?: number; + member: Member; + secretCode?: string; + createDate?: Date; + updateDate?: Date; + otpAuthUrl?: string; +} diff --git a/src/model/member/index.ts b/src/model/member/index.ts new file mode 100644 index 0000000..63d95b7 --- /dev/null +++ b/src/model/member/index.ts @@ -0,0 +1 @@ +export * from './Member'; diff --git a/src/model/meta/crawler-input-item/MetaCrawlerInputItem.ts b/src/model/meta/crawler-input-item/MetaCrawlerInputItem.ts new file mode 100644 index 0000000..7e072fd --- /dev/null +++ b/src/model/meta/crawler-input-item/MetaCrawlerInputItem.ts @@ -0,0 +1,17 @@ +import { MetaInputType } from 'model/meta/input-type/MetaInputType'; +import { MetaCrawler } from 'model/meta/crawler/MetaCrawler'; + + +export interface MetaCrawlerInputItem { + id?: number; + inputType?: MetaInputType; + crawler?: MetaCrawler; + description?: string; + name?: string; + createDate?: Date; + required?: boolean; + defaultValue?: string; + pattern?: string; + keyName?: string; + keyValue?: string; +} diff --git a/src/model/meta/crawler/MetaCrawler.ts b/src/model/meta/crawler/MetaCrawler.ts new file mode 100644 index 0000000..7467fad --- /dev/null +++ b/src/model/meta/crawler/MetaCrawler.ts @@ -0,0 +1,34 @@ + +export interface MetaCrawler { + id: number; + createDate?: Date; + name?: string; + description?: string; +} + +export enum MetaCrawler_ID { + ACTIVEDIRECTORY_CRAWLER = 1, + CASSANDRA_CRAWLER = 2, + DHCP_CRAWLER = 3, + DNS_CRAWLER = 4, + FTP_CRAWLER = 5, + HTTP_CRAWLER = 6, + IMAP_CRAWLER = 7, + LDAP_CRAWLER = 8, + MONGODB_CRAWLER = 9, + MSSQL_CRAWLER = 10, + MYSQL_CRAWLER = 11, + NETBIOS_CRAWLER = 12, + ORACLE_CRAWLER = 13, + POP_CRAWLER = 14, + POSTGRESQL_CRAWLER = 15, + REDIS_CRAWLER = 16, + RMI_CRAWLER = 17, + SMB_CRAWLER = 18, + SMTP_CRAWLER = 19, + SNMP_CRAWLER = 20, + SSH_CRAWLER = 21, + TELNET_CRAWLER = 22, + WMI_CRAWLER = 23, + UNKNOWN_CRAWLER = 24, +} diff --git a/src/model/meta/history-type/MetaHistoryType.ts b/src/model/meta/history-type/MetaHistoryType.ts new file mode 100644 index 0000000..052b3cc --- /dev/null +++ b/src/model/meta/history-type/MetaHistoryType.ts @@ -0,0 +1,14 @@ +export interface MetaHistoryType { + id?: number; + name?: string; + createDate?: Date; +} + +export enum MetaHistoryType_ID { + Member = 1, + Probe = 2, + Discovery = 3, + Target = 4, + Crawler = 5, + Sensor = 6, +} diff --git a/src/model/meta/infra-type/MetaInfraType.ts b/src/model/meta/infra-type/MetaInfraType.ts new file mode 100644 index 0000000..7dea3a9 --- /dev/null +++ b/src/model/meta/infra-type/MetaInfraType.ts @@ -0,0 +1,15 @@ +export interface MetaInfraType { + id?: number; + name?: string; + createDate?: Date; +} + +export enum MetaInfraType_ID { + MACHINE = 1, + HOST = 2, + OS = 3, + OS_APPLICATION = 4, + OS_DAEMON = 5, + OS_PORT = 6, + OS_SERVICE = 7, +} diff --git a/src/model/meta/infra-vendor/MetaInfraVendor.ts b/src/model/meta/infra-vendor/MetaInfraVendor.ts new file mode 100644 index 0000000..8202870 --- /dev/null +++ b/src/model/meta/infra-vendor/MetaInfraVendor.ts @@ -0,0 +1,65 @@ +import { MetaInfraType } from 'model/meta/infra-type/MetaInfraType'; + + +export interface MetaInfraVendor { + id?: number; + name?: string; + createDate?: Date; + infraType?: MetaInfraType; +} + +export enum MetaInfraVendor_Machine_ID { + APPLE = 1, + MICROSOFT = 2, + ASUS = 3, + HP = 4, + DELL = 5, + LENOVO = 6, + ACER = 7, + SAMSUNG = 8, + LG = 9, + CISCO = 10, +} + +export enum MetaInfraVendor_HOST_ID { + Windows = 11, + Linux = 12, + MacOS = 13, + Ubuntu = 14, + CentOS = 15, + Fedora = 16, + RedHat = 17, + Debian = 18, + SUSE = 19, + CoreOS = 20, + AmazonLinux = 21, + Kubernetes = 22, + Docker = 23, + iOS = 24, + Android = 25, +} + +export enum MetaInfraVendor_OS_ID { + Windows = 26, + MacOS = 27, + Ubuntu = 28, + CentOS = 29, + Fedora = 30, + RedHat = 31, + Debian = 32, + SUSE = 33, + CoreOS = 34, + AmazonLinux = 35, + Kubernetes = 36, + Docker = 37, + iOS = 38, + Android = 39, +} + +export enum MetaInfraVendor_SERVICE_ID { + MySql = 40, + PostgreSQL = 41, + WMI = 42, + SNMP_V2 = 43, + UNKNOWN = 44, +} diff --git a/src/model/meta/input-type/MetaInputType.ts b/src/model/meta/input-type/MetaInputType.ts new file mode 100644 index 0000000..83a028b --- /dev/null +++ b/src/model/meta/input-type/MetaInputType.ts @@ -0,0 +1,14 @@ +export interface MetaInputType { + id?: number; + name: string; + description: string; + createDate: Date; +} + +export enum MetaInputType_ID { + TEXT_TYPE = 1, + PASSWORD_TYPE = 2, + NUMBER_TYPE = 3, + BOOLEAN_TYPE = 4, + SELECT_TYPE = 5, +} diff --git a/src/model/meta/member-status/MetaMemberStatus.ts b/src/model/meta/member-status/MetaMemberStatus.ts new file mode 100644 index 0000000..6022652 --- /dev/null +++ b/src/model/meta/member-status/MetaMemberStatus.ts @@ -0,0 +1,11 @@ +export interface MetaMemberStatus { + id: number; + name: string; +} + +export enum MetaMemberStatus_ID { + NOAUTH = 1, + NORMAL = 2, + DIAPAUSE = 3, + WITHDRAWAL = 4, +} diff --git a/src/model/meta/model-temp/MetaVendorCrawler.ts b/src/model/meta/model-temp/MetaVendorCrawler.ts new file mode 100644 index 0000000..2cd9e22 --- /dev/null +++ b/src/model/meta/model-temp/MetaVendorCrawler.ts @@ -0,0 +1,10 @@ + +import { MetaCrawler } from 'model/meta/crawler/MetaCrawler'; +import { MetaInfraVendor } from 'model/meta/infra-vendor/MetaInfraVendor'; + +export interface MetaVendorCrawler { + id?: number; + crawler: MetaCrawler; + infraVendor: MetaInfraVendor; + createDate: Date; +} diff --git a/src/model/meta/model-temp/MetaVendorCrawlerSensorItem.ts b/src/model/meta/model-temp/MetaVendorCrawlerSensorItem.ts new file mode 100644 index 0000000..ddad80c --- /dev/null +++ b/src/model/meta/model-temp/MetaVendorCrawlerSensorItem.ts @@ -0,0 +1,13 @@ +import { MetaSensorItem } from 'model/meta/sensor-item/MetaSensorItem'; +import { MetaInfraVendor } from 'model/meta/infra-vendor/MetaInfraVendor'; + + +export interface MetaVendorCrawlerSensorItem { + id?: number; + interval: string; + warnCondition: string; + createDate: Date; + sensorItem: MetaSensorItem; + vendor: MetaInfraVendor; + crawlerId: number; +} diff --git a/src/model/meta/model-temp/index.ts b/src/model/meta/model-temp/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/model/meta/noauth-probe-status/MetaNoAuthProbeStatus.ts b/src/model/meta/noauth-probe-status/MetaNoAuthProbeStatus.ts new file mode 100644 index 0000000..45a6c86 --- /dev/null +++ b/src/model/meta/noauth-probe-status/MetaNoAuthProbeStatus.ts @@ -0,0 +1,11 @@ + +export interface MetaNoAuthProbeStatus { + id?: number; + name: string; +} + +export enum MetaNoAuthProbeStatus_ID { + ACCEPT = 1, + DENY = 2, + PROCESS = 3, +} diff --git a/src/model/meta/notification/MetaNotification.ts b/src/model/meta/notification/MetaNotification.ts new file mode 100644 index 0000000..3b88346 --- /dev/null +++ b/src/model/meta/notification/MetaNotification.ts @@ -0,0 +1,7 @@ + +export interface MetaNotification { + id?: number; + createDate: Date; + name: string; + description: string; +} diff --git a/src/model/meta/probe-architecture/MetaProbeArchitecture.ts b/src/model/meta/probe-architecture/MetaProbeArchitecture.ts new file mode 100644 index 0000000..1e0e45b --- /dev/null +++ b/src/model/meta/probe-architecture/MetaProbeArchitecture.ts @@ -0,0 +1,11 @@ + +export interface MetaProbeArchitecture { + id?: number; + architecture: string; + createDate: Date; +} + +export enum MetaProbeArchitecture_ID { + x86_64bit = 1, +} + diff --git a/src/model/meta/probe-os/MetaProbeOs.ts b/src/model/meta/probe-os/MetaProbeOs.ts new file mode 100644 index 0000000..2d8958f --- /dev/null +++ b/src/model/meta/probe-os/MetaProbeOs.ts @@ -0,0 +1,13 @@ + +export interface MetaProbeOs { + id?: number; + name: string; + createDate: Date; +} + +export enum MetaProbeOs_ID { + Windows = 1, + Debian = 2, + Ubuntu = 3, + Fedora = 4, +} diff --git a/src/model/meta/probe-package/MetaProbePackage.ts b/src/model/meta/probe-package/MetaProbePackage.ts new file mode 100644 index 0000000..c7e752d --- /dev/null +++ b/src/model/meta/probe-package/MetaProbePackage.ts @@ -0,0 +1,11 @@ +import { MetaProbeVersion } from 'model/meta/probe-version/MetaProbeVersion'; +import { MetaProbeOs } from 'model/meta/probe-os/MetaProbeOs'; +import { MetaProbeArchitecture } from 'model/meta/probe-architecture/MetaProbeArchitecture'; + +export interface MetaProbePackage { + id?: number; + version: MetaProbeVersion; + os: MetaProbeOs; + architecture: MetaProbeArchitecture; + createDate: Date; +} diff --git a/src/model/meta/probe-status/MetaProbeStatus.ts b/src/model/meta/probe-status/MetaProbeStatus.ts new file mode 100644 index 0000000..dccffbb --- /dev/null +++ b/src/model/meta/probe-status/MetaProbeStatus.ts @@ -0,0 +1,10 @@ + +export interface MetaProbeStatus { + id: number; + name: string; +} + +export enum MetaProbeStatus_ID { + INITIAL = 1, + NORMAL = 2, +} diff --git a/src/model/meta/probe-task-type/MetaProbeTaskType.ts b/src/model/meta/probe-task-type/MetaProbeTaskType.ts new file mode 100644 index 0000000..d6a9f4b --- /dev/null +++ b/src/model/meta/probe-task-type/MetaProbeTaskType.ts @@ -0,0 +1,7 @@ + +export interface MetaProbeTaskType { + id?: number; + name: string; + description: string; + createDate: Date; +} diff --git a/src/model/meta/probe-version/MetaProbeVersion.ts b/src/model/meta/probe-version/MetaProbeVersion.ts new file mode 100644 index 0000000..dc9a2f1 --- /dev/null +++ b/src/model/meta/probe-version/MetaProbeVersion.ts @@ -0,0 +1,5 @@ +export interface MetaProbeVersion { + id?: number; + version: string; + createDate: Date; +} diff --git a/src/model/meta/sensor-display-item/MetaSensorDisplayItem.ts b/src/model/meta/sensor-display-item/MetaSensorDisplayItem.ts new file mode 100644 index 0000000..c4a722a --- /dev/null +++ b/src/model/meta/sensor-display-item/MetaSensorDisplayItem.ts @@ -0,0 +1,15 @@ +import { MetaCrawler } from 'model/meta/crawler/MetaCrawler'; +import { MetaSensorItemUnit } from 'model/meta/sensor-item-unit/MetaSensorItemUnit'; +import { MetaSensorItemType } from 'model/meta/sensor-item-type/MetaSensorItemType'; + +export interface MetaSensorDisplayItem { + id?: number; + key?: string; + displayName?: string; + description?: string; + crawler?: MetaCrawler; + unit?: MetaSensorItemUnit; + createDate?: Date; + default?: boolean; + itemType?: MetaSensorItemType; +} diff --git a/src/model/meta/sensor-item-key/MetaSensorItemKey.ts b/src/model/meta/sensor-item-key/MetaSensorItemKey.ts new file mode 100644 index 0000000..04c7392 --- /dev/null +++ b/src/model/meta/sensor-item-key/MetaSensorItemKey.ts @@ -0,0 +1,12 @@ +import { MetaSensorItem } from 'model/meta/sensor-item/MetaSensorItem'; +import { MetaCrawler } from 'model/meta/crawler/MetaCrawler'; + +export interface MetaSensorItemKey { + id: number; + item: MetaSensorItem; + key: string; + froms: string; + option: string; + crawler: MetaCrawler; + createDate: Date; +} diff --git a/src/model/meta/sensor-item-type/MetaSensorItemType.ts b/src/model/meta/sensor-item-type/MetaSensorItemType.ts new file mode 100644 index 0000000..648d7db --- /dev/null +++ b/src/model/meta/sensor-item-type/MetaSensorItemType.ts @@ -0,0 +1,6 @@ +export interface MetaSensorItemType { + id?: number; + name?: string; + description?: string; + createDate?: Date; +} diff --git a/src/model/meta/sensor-item-unit/MetaSensorItemUnit.ts b/src/model/meta/sensor-item-unit/MetaSensorItemUnit.ts new file mode 100644 index 0000000..0a48e66 --- /dev/null +++ b/src/model/meta/sensor-item-unit/MetaSensorItemUnit.ts @@ -0,0 +1,6 @@ +export interface MetaSensorItemUnit { + id: number; + unit: string; + createDate: Date; + mark: string; +} diff --git a/src/model/meta/sensor-item/MetaSensorItem.ts b/src/model/meta/sensor-item/MetaSensorItem.ts new file mode 100644 index 0000000..7d12762 --- /dev/null +++ b/src/model/meta/sensor-item/MetaSensorItem.ts @@ -0,0 +1,10 @@ +import { MetaSensorItemType } from 'model/meta/sensor-item-type/MetaSensorItemType'; + + +export interface MetaSensorItem { + id?: number; + itemType?: MetaSensorItemType; + key?: string; + name?: string; + createDate?: Date; +} diff --git a/src/model/meta/sensor-status/MetaSensorStatus.ts b/src/model/meta/sensor-status/MetaSensorStatus.ts new file mode 100644 index 0000000..be82dac --- /dev/null +++ b/src/model/meta/sensor-status/MetaSensorStatus.ts @@ -0,0 +1,10 @@ + +export interface MetaSensorStatus { + id?: number; + name?: string; +} + +export enum MetaSensorStatus_ID { + RUNNING = 1, + STOPPED = 2, +} diff --git a/src/model/noauth/NoAuthProbe.ts b/src/model/noauth/NoAuthProbe.ts new file mode 100644 index 0000000..db2a25a --- /dev/null +++ b/src/model/noauth/NoAuthProbe.ts @@ -0,0 +1,24 @@ +import { Probe } from 'model/probe'; +import { Domain } from 'model/domain'; +import { MetaNoAuthProbeStatus } from 'model/meta/noauth-probe-status/MetaNoAuthProbeStatus'; + +export interface NoAuthProbe { + // id?: number; + // hostName?: string; + // macAddress?: number; + // ipAddress?: number; + // status?: MetaNoAuthProbeStatus; + // tempProbeKey?: string; + // createDate?: Date; + // apiKey?: string; + // domain?: Domain; + // probe?: Probe; + id?: number; + description?: string; + status?: MetaNoAuthProbeStatus; + tempProbeKey?: string; + createDate?: Date; + apiKey?: string; + domain?: Domain; + probe?: Probe; +} diff --git a/src/model/noauth/index.ts b/src/model/noauth/index.ts new file mode 100644 index 0000000..3f150ff --- /dev/null +++ b/src/model/noauth/index.ts @@ -0,0 +1 @@ +export * from './NoAuthProbe'; diff --git a/src/model/notification/Notification.ts b/src/model/notification/Notification.ts new file mode 100644 index 0000000..91896c9 --- /dev/null +++ b/src/model/notification/Notification.ts @@ -0,0 +1,14 @@ +import { Member } from 'model/member'; + + +export interface Notification { + id?: number; + createDate?: Date; + title?: string; + message?: string; + member?: Member; + confirmDate?: Date; + url?: string; +} + + diff --git a/src/model/notification/index.ts b/src/model/notification/index.ts new file mode 100644 index 0000000..ed80171 --- /dev/null +++ b/src/model/notification/index.ts @@ -0,0 +1 @@ +export * from './Notification'; diff --git a/src/model/probe/Probe.ts b/src/model/probe/Probe.ts new file mode 100644 index 0000000..a23269a --- /dev/null +++ b/src/model/probe/Probe.ts @@ -0,0 +1,20 @@ +import { Domain } from 'model/domain/'; +import { Member } from 'model/member/'; +import { Infra } from 'model/infra/'; +import { MetaProbeStatus } from 'model/meta/probe-status/MetaProbeStatus'; + +export interface Probe { + id?: number; + status?: MetaProbeStatus; // INITIAL / NORMAL + description?: string; + createDate?: Date; + domain?: Domain; + probeKey?: string; + encryptionKey?: string; + displayName?: string; + cidr?: string; + authorizeDate?: Date; + authorizeMember?: Member; + // host?: InfraHost; + targets?: Infra[]; +} diff --git a/src/model/probe/ProbeHost.ts b/src/model/probe/ProbeHost.ts new file mode 100644 index 0000000..e0d4eca --- /dev/null +++ b/src/model/probe/ProbeHost.ts @@ -0,0 +1,9 @@ + +import { Probe } from './Probe'; +import { InfraHost } from 'model/infra'; + +export interface ProbeHost { + id?: number; + probe?: Probe; + host?: InfraHost; +} diff --git a/src/model/probe/ProbeTask.ts b/src/model/probe/ProbeTask.ts new file mode 100644 index 0000000..9605206 --- /dev/null +++ b/src/model/probe/ProbeTask.ts @@ -0,0 +1,14 @@ +import { Probe } from './Probe'; +import { MetaProbeTaskType } from 'model/meta/probe-task-type/MetaProbeTaskType'; + +export interface ProbeTask { + id?: number; + taskType: MetaProbeTaskType; + probe: Probe; + data: string; + createDate: Date; + sendDate: Date; + startDate: Date; + endDate: Date; + succeed: boolean; +} diff --git a/src/model/probe/index.ts b/src/model/probe/index.ts new file mode 100644 index 0000000..49cf0b5 --- /dev/null +++ b/src/model/probe/index.ts @@ -0,0 +1,3 @@ +export * from './Probe'; +export * from './ProbeHost'; +export * from './ProbeTask'; diff --git a/src/model/sensor-item/SensorItem.ts b/src/model/sensor-item/SensorItem.ts new file mode 100644 index 0000000..2c07e0f --- /dev/null +++ b/src/model/sensor-item/SensorItem.ts @@ -0,0 +1,9 @@ +import { MetaSensorDisplayItem } from 'model/meta/sensor-display-item/MetaSensorDisplayItem'; +import { Sensor } from 'model/sensor'; + +export interface SensorItem { + id?: number; + sensor?: Sensor; + item?: MetaSensorDisplayItem; + createDate?: Date; +} diff --git a/src/model/sensor-item/SensorItemDependency.ts b/src/model/sensor-item/SensorItemDependency.ts new file mode 100644 index 0000000..4cef543 --- /dev/null +++ b/src/model/sensor-item/SensorItemDependency.ts @@ -0,0 +1,8 @@ +import { MetaSensorDisplayItem } from 'model/meta/sensor-display-item/MetaSensorDisplayItem'; +import { MetaSensorItemKey } from 'model/meta/sensor-item-key/MetaSensorItemKey'; + +export interface SensorItemDependency { + id?: number; + item?: MetaSensorDisplayItem; + sensorItem?: MetaSensorItemKey; +} diff --git a/src/model/sensor/Sensor.ts b/src/model/sensor/Sensor.ts new file mode 100644 index 0000000..e88a832 --- /dev/null +++ b/src/model/sensor/Sensor.ts @@ -0,0 +1,14 @@ +import { Target } from 'model/target'; +import { MetaSensorStatus } from 'model/meta/sensor-status/MetaSensorStatus'; +import { MetaCrawler } from 'model/meta/crawler/MetaCrawler'; + +export interface Sensor { + id?: number; + createDate?: Date; + description?: string; + status?: MetaSensorStatus; + target?: Target; + crawler?: MetaCrawler; + crawlerInputItems?: string; + itemCount?: number; +} diff --git a/src/model/sensor/SensorRegistInfo.ts b/src/model/sensor/SensorRegistInfo.ts new file mode 100644 index 0000000..661e289 --- /dev/null +++ b/src/model/sensor/SensorRegistInfo.ts @@ -0,0 +1,14 @@ + +import { Infra } from 'model/infra'; +import { MetaCrawler } from 'model/meta/crawler/MetaCrawler'; +import { MetaSensorDisplayItem } from 'model/meta/sensor-display-item/MetaSensorDisplayItem'; + +export interface SensorRegistInfo { + sensorItemMap: Map>; + crawler: MetaCrawler; + // targetId: number; + interval: number; + // type: string; + infra: Infra; + crawlerAuth: string; +} diff --git a/src/model/sensor/index.ts b/src/model/sensor/index.ts new file mode 100644 index 0000000..c814e10 --- /dev/null +++ b/src/model/sensor/index.ts @@ -0,0 +1,2 @@ +export * from './Sensor'; +export * from './SensorRegistInfo'; diff --git a/src/model/target/Target.ts b/src/model/target/Target.ts new file mode 100644 index 0000000..a174583 --- /dev/null +++ b/src/model/target/Target.ts @@ -0,0 +1,11 @@ +import { Probe } from 'model/probe'; +import { Infra } from 'model/infra'; +import { Sensor } from 'model/sensor'; + +export interface Target { + id?: number; + createDate?: Date; + displayName?: string; + description?: string; + sensors?: Sensor[]; +} diff --git a/src/model/target/index.ts b/src/model/target/index.ts new file mode 100644 index 0000000..9f2d747 --- /dev/null +++ b/src/model/target/index.ts @@ -0,0 +1 @@ +export * from './Target'; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f6106ad --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./src", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "newLine": "LF", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es5", + "typeRoots": [ + "node_modules/@types" + ], + "types": [ + "reflect-metadata", + ], + "lib": [ + "es2017", + "dom" + ] + } +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..a36a2fe --- /dev/null +++ b/tslint.json @@ -0,0 +1,139 @@ +{ + "rulesDirectory": [ + "node_modules/codelyzer" + ], + "rules": { + "arrow-return-shorthand": true, + "callable-types": true, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "import-blacklist": [ + true, + "rxjs" + ], + "import-spacing": true, + "indent": [ + true, + "spaces" + ], + "interface-over-type-literal": true, + "label-position": true, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-super": true, + "no-empty": false, + "no-empty-interface": true, + "no-eval": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-misused-new": true, + "no-non-null-assertion": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unnecessary-initializer": true, + "no-unused-expression": true, + "no-use-before-define": ["error", { "functions": true, "classes": true }], + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "prefer-const": true, + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "typeof-compare": true, + "unified-signatures": true, + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + "directive-selector": [ + true, + "attribute", + "of", + "camelCase" + ], + "component-selector": [ + true, + "element", + "of", + "kebab-case" + ], + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true + } +}