Browse Source
Task/migrate away from deprecated node10 module resolution (#7665)
* feat(api): migrate tsconfig module to preserve
* fix(api): update yahoo-finance2 ESM imports
* feat(api): update yahoo-finance2 type import
pull/7529/merge
Kenrick Tandrian
9 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
10 additions and
16 deletions
-
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
-
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
-
apps/api/tsconfig.app.json
-
apps/api/tsconfig.spec.json
|
|
|
@ -20,7 +20,7 @@ import { |
|
|
|
} from '@prisma/client'; |
|
|
|
import { isISIN } from 'class-validator'; |
|
|
|
import YahooFinance from 'yahoo-finance2'; |
|
|
|
import type { Price } from 'yahoo-finance2/esm/src/modules/quoteSummary-iface'; |
|
|
|
import type { Price } from 'yahoo-finance2/modules/quoteSummary-iface'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
|
|
|
|
|
@ -25,20 +25,17 @@ import { addDays, format, isSameDay } from 'date-fns'; |
|
|
|
import { ReasonPhrases, StatusCodes } from 'http-status-codes'; |
|
|
|
import { uniqBy } from 'lodash'; |
|
|
|
import YahooFinance from 'yahoo-finance2'; |
|
|
|
import { ChartResultArray } from 'yahoo-finance2/esm/src/modules/chart'; |
|
|
|
import { |
|
|
|
import type { ChartResultArray } from 'yahoo-finance2/modules/chart'; |
|
|
|
import type { |
|
|
|
HistoricalDividendsResult, |
|
|
|
HistoricalHistoryResult |
|
|
|
} from 'yahoo-finance2/esm/src/modules/historical'; |
|
|
|
import { |
|
|
|
Quote, |
|
|
|
QuoteResponseArray |
|
|
|
} from 'yahoo-finance2/esm/src/modules/quote'; |
|
|
|
import { |
|
|
|
} from 'yahoo-finance2/modules/historical'; |
|
|
|
import type { Quote, QuoteResponseArray } from 'yahoo-finance2/modules/quote'; |
|
|
|
import type { |
|
|
|
Price, |
|
|
|
QuoteSummaryResult |
|
|
|
} from 'yahoo-finance2/esm/src/modules/quoteSummary'; |
|
|
|
import { SearchQuoteNonYahoo } from 'yahoo-finance2/esm/src/modules/search'; |
|
|
|
} from 'yahoo-finance2/modules/quoteSummary'; |
|
|
|
import type { SearchQuoteNonYahoo } from 'yahoo-finance2/modules/search'; |
|
|
|
|
|
|
|
@Injectable() |
|
|
|
export class YahooFinanceService implements DataProviderInterface { |
|
|
|
|
|
|
|
@ -4,10 +4,8 @@ |
|
|
|
"outDir": "../../dist/out-tsc", |
|
|
|
"types": ["node"], |
|
|
|
"emitDecoratorMetadata": true, |
|
|
|
"ignoreDeprecations": "6.0", |
|
|
|
"moduleResolution": "node10", |
|
|
|
"target": "es2021", |
|
|
|
"module": "commonjs" |
|
|
|
"module": "preserve" |
|
|
|
}, |
|
|
|
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], |
|
|
|
"include": ["**/*.ts"] |
|
|
|
|
|
|
|
@ -2,8 +2,7 @@ |
|
|
|
"extends": "./tsconfig.json", |
|
|
|
"compilerOptions": { |
|
|
|
"outDir": "../../dist/out-tsc", |
|
|
|
"module": "commonjs", |
|
|
|
"moduleResolution": "node10", |
|
|
|
"module": "preserve", |
|
|
|
"types": ["jest", "node"] |
|
|
|
}, |
|
|
|
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts", "jest.config.ts"] |
|
|
|
|