chore(src): 🔧 Update TypeScript files in src directory
This commit is contained in:
parent
a6d5583913
commit
1d18c96a6a
15 changed files with 51 additions and 37 deletions
|
|
@ -1,12 +1,13 @@
|
|||
import { Injectable, HttpException, HttpStatus } from '@nestjs/common';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
|
||||
import { RATE_LIMIT_KEY } from '@/auth/decorators/rate-limit.decorator';
|
||||
|
||||
import type { RateLimitOptions } from '@/auth/decorators/rate-limit.decorator';
|
||||
import type { CanActivate, ExecutionContext } from '@nestjs/common';
|
||||
import type { Request } from 'express';
|
||||
|
||||
import { RATE_LIMIT_KEY } from '@/auth/decorators/rate-limit.decorator';
|
||||
|
||||
interface RateLimitEntry {
|
||||
count: number;
|
||||
resetAt: number; // Timestamp in milliseconds
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { AlertService } from './alert.service';
|
||||
import { DataRetentionCron } from './data-retention.cron';
|
||||
import { VPSMonitoringCron } from './vps-monitoring.cron';
|
||||
|
||||
import { ConfigModule } from '@/config/config.module';
|
||||
import { DatabaseModule } from '@/database/database.module';
|
||||
import { StorageModule } from '@/storage/storage.module';
|
||||
import { VPSModule } from '@/vps/vps.module';
|
||||
|
||||
import { AlertService } from './alert.service';
|
||||
import { DataRetentionCron } from './data-retention.cron';
|
||||
import { VPSMonitoringCron } from './vps-monitoring.cron';
|
||||
|
||||
/**
|
||||
* Cron Module
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Cron, CronExpression } from '@nestjs/schedule';
|
||||
|
||||
import { DataRetentionService } from '@/storage/data-retention.service';
|
||||
import { BigdiskBackupService } from '@/storage/bigdisk-backup.service';
|
||||
|
||||
import type { OnModuleInit } from '@nestjs/common';
|
||||
|
||||
import { BigdiskBackupService } from '@/storage/bigdisk-backup.service';
|
||||
import { DataRetentionService } from '@/storage/data-retention.service';
|
||||
|
||||
|
||||
/**
|
||||
* Data Retention Cron
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Cron, CronExpression } from '@nestjs/schedule';
|
||||
|
||||
import { AlertService } from './alert.service';
|
||||
|
||||
import type { OnModuleInit } from '@nestjs/common';
|
||||
|
||||
import { ConfigService } from '@/config/config.service';
|
||||
import { ContainerDependencyRepository } from '@/database/repositories/container-dependency.repository';
|
||||
import { DockerContainerSnapshotRepository } from '@/database/repositories/docker-container-snapshot.repository';
|
||||
|
|
@ -8,9 +12,7 @@ import { DockerEventRepository } from '@/database/repositories/docker-event.repo
|
|||
import { VPSResourceSnapshotRepository } from '@/database/repositories/vps-resource-snapshot.repository';
|
||||
import { VPSAgentService } from '@/vps/vps-agent.service';
|
||||
|
||||
import { AlertService } from './alert.service';
|
||||
|
||||
import type { OnModuleInit } from '@nestjs/common';
|
||||
|
||||
/**
|
||||
* VPS Monitoring Cron
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { ConfigModule } from '@/config/config.module';
|
||||
import { ConfigService } from '@/config/config.service';
|
||||
|
||||
import { getDatabaseConfig } from './database.config';
|
||||
import {
|
||||
|
|
@ -22,6 +20,9 @@ import {
|
|||
ContainerDependencyRepository,
|
||||
} from './repositories';
|
||||
|
||||
import { ConfigModule } from '@/config/config.module';
|
||||
import { ConfigService } from '@/config/config.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import { MigrationInterface, QueryRunner, Table, TableIndex } from 'typeorm';
|
||||
import { Table, TableIndex } from 'typeorm';
|
||||
|
||||
import type { MigrationInterface, QueryRunner} from 'typeorm';
|
||||
|
||||
/**
|
||||
* Migration to add aggregate tables for data retention
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { Injectable } from '@nestjs/common';
|
|||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import type { DependencyGraph } from '@/vps/vps-agent.service';
|
||||
|
||||
import { ContainerDependency } from '@/database/entities/container-dependency.entity';
|
||||
|
||||
import type { DependencyGraph } from '@/vps/vps-agent.service';
|
||||
|
||||
/**
|
||||
* Container Dependency Repository
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { Injectable } from '@nestjs/common';
|
|||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository, LessThan } from 'typeorm';
|
||||
|
||||
import type { DockerContainer } from '@/vps/vps-agent.service';
|
||||
|
||||
import { DockerContainerSnapshot } from '@/database/entities/docker-container-snapshot.entity';
|
||||
|
||||
import type { DockerContainer } from '@/vps/vps-agent.service';
|
||||
|
||||
/**
|
||||
* Docker Container Snapshot Repository
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { Injectable } from '@nestjs/common';
|
|||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository, LessThan } from 'typeorm';
|
||||
|
||||
import type { DockerEvent } from '@/vps/vps-agent.service';
|
||||
|
||||
import { DockerEvent as DockerEventEntity } from '@/database/entities/docker-event.entity';
|
||||
|
||||
import type { DockerEvent } from '@/vps/vps-agent.service';
|
||||
|
||||
/**
|
||||
* Docker Event Repository
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { Injectable } from '@nestjs/common';
|
|||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository, LessThan } from 'typeorm';
|
||||
|
||||
import type { VPSResources } from '@/vps/vps-agent.service';
|
||||
|
||||
import { VpsResourceSnapshot } from '@/database/entities/vps-resource-snapshot.entity';
|
||||
|
||||
import type { VPSResources } from '@/vps/vps-agent.service';
|
||||
|
||||
/**
|
||||
* VPS Resource Snapshot Repository
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { DomainHealthService } from './domain-health.service';
|
||||
|
||||
import { VPSModule } from '@/vps/vps.module';
|
||||
|
||||
import { DomainHealthService } from './domain-health.service';
|
||||
|
||||
/**
|
||||
* Domain Module
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@
|
|||
* - ORCHESTRATOR_STARTUP_COMPLETED: Startup session completes
|
||||
*/
|
||||
|
||||
import { Processor } from '@nestjs/bullmq';
|
||||
import { forwardRef, Inject, Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import {
|
||||
BaseDomainEvent,
|
||||
DomainEventType,
|
||||
|
|
@ -30,6 +27,9 @@ import {
|
|||
OrchestratorStartupCompletedPayload,
|
||||
} from '@lilith/domain-events';
|
||||
import { BaseDomainEventsProcessor } from '@lilith/domain-events/processors';
|
||||
import { Processor } from '@nestjs/bullmq';
|
||||
import { forwardRef, Inject, Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
|
||||
import { HealthGateway } from '@/api/health.gateway';
|
||||
import { MetricsStorageService } from '@/storage/metrics-storage.service';
|
||||
|
|
|
|||
|
|
@ -8,15 +8,16 @@
|
|||
* - OrchestratorEventsProcessor: Handles orchestrator startup session events
|
||||
*/
|
||||
|
||||
import { Module } from '@nestjs/common';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { StorageModule } from '@/storage/storage.module';
|
||||
import { ServicesModule } from '@/services/services.module';
|
||||
import { APIModule } from '@/api/api.module';
|
||||
|
||||
import { SystemEventsProcessor } from './system-events.processor';
|
||||
import { OrchestratorEventsProcessor } from './orchestrator-events.processor';
|
||||
import { SystemEventsProcessor } from './system-events.processor';
|
||||
|
||||
import { APIModule } from '@/api/api.module';
|
||||
import { ServicesModule } from '@/services/services.module';
|
||||
import { StorageModule } from '@/storage/storage.module';
|
||||
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
|
|
|||
|
|
@ -12,9 +12,6 @@
|
|||
* - SYSTEM_ALERT_RESOLVED: System alert was cleared
|
||||
*/
|
||||
|
||||
import { Processor } from '@nestjs/bullmq'
|
||||
import { forwardRef, Inject, Injectable, Logger } from '@nestjs/common'
|
||||
|
||||
import {
|
||||
BaseDomainEvent,
|
||||
DomainEventType,
|
||||
|
|
@ -31,10 +28,13 @@ import {
|
|||
ServiceMetadataUpdatedPayload,
|
||||
} from '@lilith/domain-events'
|
||||
import { BaseDomainEventsProcessor } from '@lilith/domain-events/processors'
|
||||
import { Processor } from '@nestjs/bullmq'
|
||||
import { forwardRef, Inject, Injectable, Logger } from '@nestjs/common'
|
||||
|
||||
|
||||
import { HealthGateway } from '@/api/health.gateway'
|
||||
import { MetricsStorageService } from '@/storage/metrics-storage.service'
|
||||
import { getServiceById } from '@/services/services.config'
|
||||
import { MetricsStorageService } from '@/storage/metrics-storage.service'
|
||||
|
||||
@Processor('DOMAIN_EVENTS')
|
||||
@Injectable()
|
||||
|
|
|
|||
|
|
@ -5,15 +5,21 @@
|
|||
* Supports HTTP, TCP, and command-based health checks.
|
||||
*/
|
||||
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { exec } from 'child_process';
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import * as net from 'net';
|
||||
import { promisify } from 'util';
|
||||
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { SocksProxyAgent } from 'socks-proxy-agent';
|
||||
|
||||
import {
|
||||
HostStatusDto,
|
||||
ServiceHealthStatus,
|
||||
ServiceStatusDto,
|
||||
ServicesResponseDto,
|
||||
} from './dto/service-status.dto';
|
||||
import {
|
||||
getAllHosts,
|
||||
getAllServices,
|
||||
|
|
@ -23,12 +29,6 @@ import {
|
|||
HostConfig,
|
||||
ServiceConfig,
|
||||
} from './services.config';
|
||||
import {
|
||||
HostStatusDto,
|
||||
ServiceHealthStatus,
|
||||
ServiceStatusDto,
|
||||
ServicesResponseDto,
|
||||
} from './dto/service-status.dto';
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue