|
@ -17,6 +17,7 @@ import { |
|
|
ghostfolioFearAndGreedIndexDataSource |
|
|
ghostfolioFearAndGreedIndexDataSource |
|
|
} from '@ghostfolio/common/config'; |
|
|
} from '@ghostfolio/common/config'; |
|
|
import { |
|
|
import { |
|
|
|
|
|
DATE_FORMAT, |
|
|
encodeDataSource, |
|
|
encodeDataSource, |
|
|
extractNumberFromString |
|
|
extractNumberFromString |
|
|
} from '@ghostfolio/common/helper'; |
|
|
} from '@ghostfolio/common/helper'; |
|
@ -31,7 +32,7 @@ import { Injectable, Logger } from '@nestjs/common'; |
|
|
import { JwtService } from '@nestjs/jwt'; |
|
|
import { JwtService } from '@nestjs/jwt'; |
|
|
import * as bent from 'bent'; |
|
|
import * as bent from 'bent'; |
|
|
import * as cheerio from 'cheerio'; |
|
|
import * as cheerio from 'cheerio'; |
|
|
import { subDays } from 'date-fns'; |
|
|
import { format, subDays } from 'date-fns'; |
|
|
|
|
|
|
|
|
@Injectable() |
|
|
@Injectable() |
|
|
export class InfoService { |
|
|
export class InfoService { |
|
@ -346,7 +347,10 @@ export class InfoService { |
|
|
)) as string; |
|
|
)) as string; |
|
|
|
|
|
|
|
|
const get = bent( |
|
|
const get = bent( |
|
|
`https://betteruptime.com/api/v2/monitors/${monitorId}/sla`, |
|
|
`https://betteruptime.com/api/v2/monitors/${monitorId}/sla?from=${format( |
|
|
|
|
|
subDays(new Date(), 90), |
|
|
|
|
|
DATE_FORMAT |
|
|
|
|
|
)}&to${format(new Date(), DATE_FORMAT)}`,
|
|
|
'GET', |
|
|
'GET', |
|
|
'json', |
|
|
'json', |
|
|
200, |
|
|
200, |
|
|