laplace-api 1.0.9 → 1.0.11

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laplace-api",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Client library for Laplace API for the US stock market and BIST (Istanbul stock market) fundamental financial data.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,21 +2,18 @@ import { Client } from './client';
2
2
  import { Region } from './collections';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
 
5
- async function* getLivePrice<T>(
5
+ function getLivePrice<T>(
6
6
  client: Client,
7
7
  symbols: string[],
8
8
  region: Region,
9
9
  streamId: string = uuidv4(),
10
- ): AsyncGenerator<T, void, undefined> {
10
+ ): {
11
+ events: AsyncIterable<T>,
12
+ cancel: () => void
13
+ } {
11
14
  const url = `${client["baseUrl"]}/api/v1/stock/price/live?filter=${symbols.join(',')}&region=${region}&stream=${streamId}`;
12
15
 
13
- const { events, cancel } = client.sendSSERequest<T>(url);
14
-
15
- try {
16
- yield* events;
17
- } finally {
18
- cancel();
19
- }
16
+ return client.sendSSERequest<T>(url);
20
17
  }
21
18
 
22
19
  export interface BISTStockLiveData {
@@ -36,7 +33,10 @@ export class LivePriceClient extends Client {
36
33
  symbols: string[],
37
34
  region: Region,
38
35
  streamId?: string,
39
- ): AsyncGenerator<BISTStockLiveData, void, undefined> {
36
+ ): {
37
+ events: AsyncIterable<BISTStockLiveData>,
38
+ cancel: () => void
39
+ } {
40
40
  return getLivePrice<BISTStockLiveData>(this, symbols, region, streamId);
41
41
  }
42
42
 
@@ -44,7 +44,10 @@ export class LivePriceClient extends Client {
44
44
  symbols: string[],
45
45
  region: Region,
46
46
  streamId?: string,
47
- ): AsyncGenerator<USStockLiveData, void, undefined> {
47
+ ): {
48
+ events: AsyncIterable<USStockLiveData>,
49
+ cancel: () => void
50
+ } {
48
51
  return getLivePrice<USStockLiveData>(this, symbols, region, streamId);
49
52
  }
50
53
  }
@@ -11,10 +11,10 @@ export enum SearchType {
11
11
  export interface SearchResponseStock {
12
12
  id: string;
13
13
  name: string;
14
- symbol: string;
14
+ title: string;
15
15
  region: string;
16
- assetClass: string;
17
16
  assetType: string;
17
+ type: string;
18
18
  }
19
19
 
20
20
  export interface SearchResponseCollection {