@laboratory-one/api-components 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratory-one/api-components",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "API components for Laboratory One",
5
5
  "author": "Laboratory One",
6
6
  "private": false,
@@ -1,22 +1,23 @@
1
- import * as healthCheckResultInterface from '@nestjs/terminus/dist/health-check/health-check-result.interface';
2
1
  import { IsString } from 'class-validator';
3
2
  import { ApiProperty } from '@nestjs/swagger';
4
- import * as healthIndicator from '@nestjs/terminus/dist/health-indicator';
3
+ import type {
4
+ HealthCheckResult,
5
+ HealthCheckStatus,
6
+ HealthIndicatorResult,
7
+ } from '@nestjs/terminus';
5
8
 
6
- export class HealthResponseDto
7
- implements healthCheckResultInterface.HealthCheckResult
8
- {
9
+ export class HealthResponseDto implements HealthCheckResult {
9
10
  @ApiProperty()
10
- status: healthCheckResultInterface.HealthCheckStatus;
11
+ status: HealthCheckStatus;
11
12
 
12
13
  @ApiProperty()
13
- info?: healthIndicator.HealthIndicatorResult;
14
+ info?: HealthIndicatorResult;
14
15
 
15
16
  @ApiProperty()
16
- error?: healthIndicator.HealthIndicatorResult;
17
+ error?: HealthIndicatorResult;
17
18
 
18
19
  @ApiProperty()
19
- details: healthIndicator.HealthIndicatorResult;
20
+ details: HealthIndicatorResult;
20
21
 
21
22
  @IsString()
22
23
  @ApiProperty()
@@ -1,11 +1,10 @@
1
1
  import { Injectable, Logger } from '@nestjs/common';
2
2
  import {
3
+ HealthCheckResult,
3
4
  HealthCheckService,
4
- HttpHealthIndicator,
5
5
  MemoryHealthIndicator,
6
6
  } from '@nestjs/terminus';
7
7
  import { ConfigService } from '@nestjs/config';
8
- import { HealthCheckResult } from '@nestjs/terminus/dist/health-check/health-check-result.interface';
9
8
 
10
9
  import { HealthResponseDto } from './dtos/health.response.dto';
11
10
 
@@ -19,7 +18,6 @@ export class HealthService {
19
18
  constructor(
20
19
  private readonly configService: ConfigService,
21
20
  private readonly health: HealthCheckService,
22
- private readonly http: HttpHealthIndicator,
23
21
  private readonly memory: MemoryHealthIndicator,
24
22
  ) {}
25
23
 
@@ -28,7 +26,6 @@ export class HealthService {
28
26
  this.logger.log('check');
29
27
 
30
28
  const statuses: HealthCheckResult = await this.health.check([
31
- async () => this.http.pingCheck('website', 'https://google.com'),
32
29
  async () => this.memory.checkHeap('memoryHeap', 200 * 1024 * 1024),
33
30
  async () => this.memory.checkRSS('memoryRss', 3000 * 1024 * 1024),
34
31
  ]);