laplace-api
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "laplace-api", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Client library for Laplace API for the US stock market and BIST (Istanbul stock market) fundamental financial data.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -70,3 +70,3 @@ import { Client } from './client'; | ||
async createCustomTheme(params: CreateCustomThemeParams): Promise<string> { | ||
const response = await this.sendRequest<string>({ | ||
const response = await this.sendRequest<{ id: string }>({ | ||
method: 'POST', | ||
@@ -77,3 +77,3 @@ url: `/api/v1/custom-theme`, | ||
return response; | ||
return response.id; | ||
} | ||
@@ -80,0 +80,0 @@ |
@@ -130,7 +130,11 @@ import { Client } from './client'; | ||
export class StockClient extends Client { | ||
async getAllStocks(region: Region): Promise<Stock[]> { | ||
async getAllStocks(region: Region, page: number|null = null, pageSize: number|null = null): Promise<Stock[]> { | ||
return this.sendRequest<Stock[]>({ | ||
method: 'GET', | ||
url: '/api/v1/stock/all', | ||
params: { region }, | ||
url: '/api/v2/stock/all', | ||
params: { | ||
region, | ||
...(page !== null ? { page } : {}), | ||
...(pageSize !== null ? { pageSize } : {}), | ||
}, | ||
}); | ||
@@ -137,0 +141,0 @@ } |
@@ -29,2 +29,9 @@ import { Logger } from 'winston'; | ||
test('GetAllStocksWithPagination', async () => { | ||
const resp = await client.getAllStocks(Region.Tr, 10, 10); | ||
expect(resp).not.toBeEmpty(); | ||
expect(resp.length).toBe(10); | ||
}); | ||
test('GetStockDetailByID', async () => { | ||
@@ -31,0 +38,0 @@ const resp = await client.getStockDetailById("61dd0d6f0ec2114146342fd0", Locale.Tr); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54896
1487