laplace-api 2.2.0 → 3.0.1
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
|
@@ -131,7 +131,7 @@ export interface HistoricalFinancialSheets {
|
|
|
131
131
|
|
|
132
132
|
export interface HistoricalFinancialSheet {
|
|
133
133
|
period: string;
|
|
134
|
-
|
|
134
|
+
items: HistoricalFinancialSheetRow[];
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
export interface HistoricalFinancialSheetRow {
|
|
@@ -212,7 +212,7 @@ export class FinancialClient extends Client {
|
|
|
212
212
|
currency: Currency,
|
|
213
213
|
region: Region
|
|
214
214
|
): Promise<HistoricalFinancialSheets> {
|
|
215
|
-
const url = new URL(`${this['baseUrl']}/api/
|
|
215
|
+
const url = new URL(`${this['baseUrl']}/api/v2/stock/historical-financial-sheets`);
|
|
216
216
|
url.searchParams.append('symbol', symbol);
|
|
217
217
|
url.searchParams.append('from', `${from.year.toString().padStart(4, '0')}-${from.month.toString().padStart(2, '0')}-${from.day.toString().padStart(2, '0')}`);
|
|
218
218
|
url.searchParams.append('to', `${to.year.toString().padStart(4, '0')}-${to.month.toString().padStart(2, '0')}-${to.day.toString().padStart(2, '0')}`);
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
FinancialSheetType,
|
|
8
8
|
FinancialSheetPeriod,
|
|
9
9
|
Currency,
|
|
10
|
+
HistoricalFinancialSheetRow,
|
|
10
11
|
} from "../client/financial_ratios";
|
|
11
12
|
import { Region, Locale } from "../client/collections";
|
|
12
13
|
import "./client_test_suite";
|
|
@@ -68,12 +69,41 @@ describe('FinancialRatios', () => {
|
|
|
68
69
|
const resp = await financialClient.getHistoricalFinancialSheets(
|
|
69
70
|
'TUPRS',
|
|
70
71
|
{ year: 2022, month: 1, day: 1 },
|
|
71
|
-
{ year:
|
|
72
|
-
FinancialSheetType.
|
|
73
|
-
FinancialSheetPeriod.
|
|
74
|
-
Currency.
|
|
72
|
+
{ year: 2025, month: 1, day: 1 },
|
|
73
|
+
FinancialSheetType.CashFlow,
|
|
74
|
+
FinancialSheetPeriod.Quarterly,
|
|
75
|
+
Currency.TRY,
|
|
75
76
|
Region.Tr
|
|
76
77
|
);
|
|
78
|
+
|
|
79
|
+
expect(resp).toBeDefined();
|
|
80
|
+
expect(resp).not.toBeNull();
|
|
77
81
|
expect(resp).not.toBeEmpty();
|
|
82
|
+
|
|
83
|
+
expect(resp.sheets).toBeDefined();
|
|
84
|
+
expect(Array.isArray(resp.sheets)).toBe(true);
|
|
85
|
+
expect(resp.sheets.length).toBeGreaterThan(0);
|
|
86
|
+
|
|
87
|
+
const firstSheet = resp.sheets[0];
|
|
88
|
+
expect(firstSheet).toBeDefined();
|
|
89
|
+
|
|
90
|
+
expect(firstSheet.period).toBeDefined();
|
|
91
|
+
expect(typeof firstSheet.period).toBe("string")
|
|
92
|
+
|
|
93
|
+
expect(firstSheet.items).toBeDefined();
|
|
94
|
+
expect(Array.isArray(firstSheet.items)).toBe(true);
|
|
95
|
+
expect(firstSheet.items.length).toBeGreaterThan(0);
|
|
96
|
+
|
|
97
|
+
const firstRow = firstSheet.items[0];
|
|
98
|
+
expect(firstRow).toBeDefined();
|
|
99
|
+
|
|
100
|
+
expect(firstRow).toMatchObject<HistoricalFinancialSheetRow>({
|
|
101
|
+
description: expect.any(String),
|
|
102
|
+
value: expect.any(Number),
|
|
103
|
+
lineCodeId: expect.any(Number),
|
|
104
|
+
indentLevel: expect.any(Number),
|
|
105
|
+
firstAncestorLineCodeId: expect.any(Number),
|
|
106
|
+
sectionLineCodeId: expect.any(Number),
|
|
107
|
+
});
|
|
78
108
|
});
|
|
79
|
-
});
|
|
109
|
+
});
|