This repository has been archived by the owner on Nov 7, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improved status; added ESI_ENDPOINT to env
- Loading branch information
1 parent
855543b
commit 49eaebe
Showing
9 changed files
with
115 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ApiModelProperty } from '@nestjs/swagger'; | ||
import { IStatus } from './status.interface'; | ||
import { IGetStatus } from '../external/esi/esi.interface'; | ||
|
||
export class DStatus { | ||
@ApiModelProperty() | ||
state: 'OK' | 'NOK'; | ||
|
||
@ApiModelProperty() | ||
version: string; | ||
|
||
@ApiModelProperty() | ||
esi: IGetStatus; | ||
|
||
constructor(status: IStatus) { | ||
this.state = status.state; | ||
this.version = status.version; | ||
this.esi = status.esi; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IGetStatus } from '../external/esi/esi.interface'; | ||
|
||
export interface IStatus { | ||
esi: IGetStatus; | ||
state: 'OK' | 'NOK'; | ||
version: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Injectable, Inject } from '@nestjs/common'; | ||
import { ESIService } from '../external/esi/esi.service'; | ||
import { IStatus } from './status.interface'; | ||
|
||
@Injectable() | ||
export class StatusService { | ||
|
||
constructor( | ||
private esiService: ESIService, | ||
) { | ||
} | ||
|
||
async status(): Promise<IStatus> { | ||
const esiStatus = await this.esiService.status(); | ||
|
||
return { | ||
esi: esiStatus, | ||
state: 'OK', | ||
version: process.env.npm_package_version, | ||
}; | ||
} | ||
} |