laplace-api 1.1.1 → 1.1.2
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
|
@@ -67,13 +67,13 @@ export class CustomThemeClient extends Client {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
async createCustomTheme(params: CreateCustomThemeParams): Promise<string> {
|
|
70
|
-
const response = await this.sendRequest<string>({
|
|
70
|
+
const response = await this.sendRequest<{ id: string }>({
|
|
71
71
|
method: 'POST',
|
|
72
72
|
url: `/api/v1/custom-theme`,
|
|
73
73
|
data: params,
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
return response;
|
|
76
|
+
return response.id;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
async updateCustomTheme(id: string, params: UpdateCustomThemeParams): Promise<void> {
|
package/src/client/stocks.ts
CHANGED
|
@@ -127,11 +127,15 @@ export interface TickSizeRule {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
export class StockClient extends Client {
|
|
130
|
-
async getAllStocks(region: Region): Promise<Stock[]> {
|
|
130
|
+
async getAllStocks(region: Region, page: number|null = null, pageSize: number|null = null): Promise<Stock[]> {
|
|
131
131
|
return this.sendRequest<Stock[]>({
|
|
132
132
|
method: 'GET',
|
|
133
|
-
url: '/api/
|
|
134
|
-
params: {
|
|
133
|
+
url: '/api/v2/stock/all',
|
|
134
|
+
params: {
|
|
135
|
+
region,
|
|
136
|
+
...(page !== null ? { page } : {}),
|
|
137
|
+
...(pageSize !== null ? { pageSize } : {}),
|
|
138
|
+
},
|
|
135
139
|
});
|
|
136
140
|
}
|
|
137
141
|
|
package/src/test/stocks.test.ts
CHANGED
|
@@ -26,6 +26,13 @@ describe('Stocks', () => {
|
|
|
26
26
|
expect(resp).not.toBeEmpty();
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
|
|
30
|
+
test('GetAllStocksWithPagination', async () => {
|
|
31
|
+
const resp = await client.getAllStocks(Region.Tr, 10, 10);
|
|
32
|
+
expect(resp).not.toBeEmpty();
|
|
33
|
+
expect(resp.length).toBe(10);
|
|
34
|
+
});
|
|
35
|
+
|
|
29
36
|
test('GetStockDetailByID', async () => {
|
|
30
37
|
const resp = await client.getStockDetailById("61dd0d6f0ec2114146342fd0", Locale.Tr);
|
|
31
38
|
expect(resp).not.toBeEmpty();
|