|
|
@ -13,7 +13,6 @@ import { |
|
|
|
PROPERTY_DEMO_USER_ID, |
|
|
|
PROPERTY_IS_READ_ONLY_MODE, |
|
|
|
PROPERTY_SLACK_COMMUNITY_USERS, |
|
|
|
PROPERTY_STRIPE_CONFIG, |
|
|
|
ghostfolioFearAndGreedIndexDataSource |
|
|
|
} from '@ghostfolio/common/config'; |
|
|
|
import { |
|
|
@ -21,13 +20,8 @@ import { |
|
|
|
encodeDataSource, |
|
|
|
extractNumberFromString |
|
|
|
} from '@ghostfolio/common/helper'; |
|
|
|
import { |
|
|
|
InfoItem, |
|
|
|
Statistics, |
|
|
|
SubscriptionOffer |
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
|
import { InfoItem, Statistics } from '@ghostfolio/common/interfaces'; |
|
|
|
import { permissions } from '@ghostfolio/common/permissions'; |
|
|
|
import { SubscriptionOfferKey } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
|
import { JwtService } from '@nestjs/jwt'; |
|
|
@ -100,8 +94,7 @@ export class InfoService { |
|
|
|
demoAuthToken, |
|
|
|
isUserSignupEnabled, |
|
|
|
platforms, |
|
|
|
statistics, |
|
|
|
subscriptionOffers |
|
|
|
statistics |
|
|
|
] = await Promise.all([ |
|
|
|
this.benchmarkService.getBenchmarkAssetProfiles(), |
|
|
|
this.getDemoAuthToken(), |
|
|
@ -109,8 +102,7 @@ export class InfoService { |
|
|
|
this.platformService.getPlatforms({ |
|
|
|
orderBy: { name: 'asc' } |
|
|
|
}), |
|
|
|
this.getStatistics(), |
|
|
|
this.getSubscriptionOffers() |
|
|
|
this.getStatistics() |
|
|
|
]); |
|
|
|
|
|
|
|
if (isUserSignupEnabled) { |
|
|
@ -125,7 +117,6 @@ export class InfoService { |
|
|
|
isReadOnlyMode, |
|
|
|
platforms, |
|
|
|
statistics, |
|
|
|
subscriptionOffers, |
|
|
|
baseCurrency: DEFAULT_CURRENCY, |
|
|
|
currencies: this.exchangeRateDataService.getCurrencies() |
|
|
|
}; |
|
|
@ -299,19 +290,6 @@ export class InfoService { |
|
|
|
return statistics; |
|
|
|
} |
|
|
|
|
|
|
|
private async getSubscriptionOffers(): Promise<{ |
|
|
|
[offer in SubscriptionOfferKey]: SubscriptionOffer; |
|
|
|
}> { |
|
|
|
if (!this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { |
|
|
|
return undefined; |
|
|
|
} |
|
|
|
|
|
|
|
return ( |
|
|
|
((await this.propertyService.getByKey(PROPERTY_STRIPE_CONFIG)) as any) ?? |
|
|
|
{} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
private async getUptime(): Promise<number> { |
|
|
|
{ |
|
|
|
try { |
|
|
|