@invezgo/sdk 1.0.0 → 1.1.0
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/README.md +187 -238
- package/dist/endpoints/alerts.d.ts +49 -0
- package/dist/endpoints/alerts.d.ts.map +1 -0
- package/dist/endpoints/analysis.d.ts +173 -56
- package/dist/endpoints/analysis.d.ts.map +1 -1
- package/dist/endpoints/journals.d.ts +22 -18
- package/dist/endpoints/journals.d.ts.map +1 -1
- package/dist/endpoints/membership.d.ts +15 -13
- package/dist/endpoints/membership.d.ts.map +1 -1
- package/dist/endpoints/recommendation.d.ts +10 -0
- package/dist/endpoints/recommendation.d.ts.map +1 -0
- package/dist/endpoints/screener.d.ts +28 -17
- package/dist/endpoints/screener.d.ts.map +1 -1
- package/dist/endpoints/watchlists.d.ts +32 -19
- package/dist/endpoints/watchlists.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +246 -179
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +246 -179
- package/dist/index.js.map +1 -1
- package/dist/invezgo.d.ts +6 -6
- package/dist/invezgo.d.ts.map +1 -1
- package/dist/types.d.ts +227 -33
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -7
package/dist/index.js
CHANGED
|
@@ -213,90 +213,174 @@ class HttpClient {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
class AlertsEndpoints {
|
|
217
|
+
constructor(client) {
|
|
218
|
+
this.client = client;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Get list of alerts.
|
|
222
|
+
*/
|
|
223
|
+
async list() {
|
|
224
|
+
return this.client.get('/alerts');
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Create alert.
|
|
228
|
+
*/
|
|
229
|
+
async add(dto) {
|
|
230
|
+
return this.client.post('/alerts', dto);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Update alert.
|
|
234
|
+
*/
|
|
235
|
+
async update(id, dto) {
|
|
236
|
+
return this.client.put(`/alerts/${id}`, dto);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Delete alert.
|
|
240
|
+
*/
|
|
241
|
+
async delete(id) {
|
|
242
|
+
return this.client.delete(`/alerts/${id}`);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Test alert formula.
|
|
246
|
+
*/
|
|
247
|
+
async test(dto) {
|
|
248
|
+
return this.client.post('/alerts/test', dto);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
216
252
|
class AnalysisEndpoints {
|
|
217
253
|
constructor(client) {
|
|
218
254
|
this.client = client;
|
|
219
255
|
}
|
|
220
256
|
/**
|
|
221
|
-
* Get list of all stocks listed on BEI
|
|
257
|
+
* Get list of all stocks listed on BEI.
|
|
222
258
|
*/
|
|
223
259
|
async getStockList() {
|
|
224
260
|
return this.client.get('/analysis/list/stock');
|
|
225
261
|
}
|
|
226
262
|
/**
|
|
227
|
-
* Get list of all brokers/securities on BEI
|
|
263
|
+
* Get list of all brokers/securities on BEI.
|
|
228
264
|
*/
|
|
229
265
|
async getBrokerList() {
|
|
230
266
|
return this.client.get('/analysis/list/broker');
|
|
231
267
|
}
|
|
232
268
|
/**
|
|
233
|
-
* Get
|
|
269
|
+
* Get list of all supported IDX indexes.
|
|
270
|
+
*/
|
|
271
|
+
async getIndexList() {
|
|
272
|
+
return this.client.get('/analysis/list/index');
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Get complete company information.
|
|
234
276
|
*/
|
|
235
277
|
async getInformation(code) {
|
|
236
278
|
return this.client.get(`/analysis/information/${code}`);
|
|
237
279
|
}
|
|
238
280
|
/**
|
|
239
|
-
* Get top gainer and loser stocks for a specific date
|
|
281
|
+
* Get top gainer and loser stocks for a specific date.
|
|
240
282
|
*/
|
|
241
283
|
async getTopChange(date) {
|
|
242
284
|
return this.client.get('/analysis/top/change', { date });
|
|
243
285
|
}
|
|
244
286
|
/**
|
|
245
|
-
* Get top foreign accumulation and distribution
|
|
287
|
+
* Get top foreign accumulation and distribution.
|
|
246
288
|
*/
|
|
247
289
|
async getTopForeign(date) {
|
|
248
290
|
return this.client.get('/analysis/top/foreign', { date });
|
|
249
291
|
}
|
|
250
292
|
/**
|
|
251
|
-
* Get top accumulation and distribution
|
|
293
|
+
* Get top bandarmology accumulation and distribution.
|
|
252
294
|
*/
|
|
253
295
|
async getTopAccumulation(date) {
|
|
254
296
|
return this.client.get('/analysis/top/accumulation', { date });
|
|
255
297
|
}
|
|
256
298
|
/**
|
|
257
|
-
* Get
|
|
299
|
+
* Get top retail accumulation and distribution.
|
|
300
|
+
*/
|
|
301
|
+
async getTopRitel(date) {
|
|
302
|
+
return this.client.get('/analysis/top/ritel', { date });
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Alias for getTopRitel.
|
|
306
|
+
*/
|
|
307
|
+
async getTopRetail(date) {
|
|
308
|
+
return this.getTopRitel(date);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Get intraday chart data.
|
|
258
312
|
*/
|
|
259
313
|
async getIntradayChart(code, market = 'RG') {
|
|
260
314
|
return this.client.get(`/analysis/intraday/${code}`, { market });
|
|
261
315
|
}
|
|
262
316
|
/**
|
|
263
|
-
* Get
|
|
317
|
+
* Get intraday stock summary data.
|
|
318
|
+
*/
|
|
319
|
+
async getIntradayData(code, market = 'RG') {
|
|
320
|
+
return this.client.get(`/analysis/intraday-data/${code}`, { market });
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Get intraday index summary data.
|
|
324
|
+
*/
|
|
325
|
+
async getIntradayIndex(code, market = 'RG') {
|
|
326
|
+
return this.client.get(`/analysis/intraday-index/${code}`, { market });
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Get order book data.
|
|
264
330
|
*/
|
|
265
331
|
async getOrderBook(code, market = 'RG') {
|
|
266
332
|
return this.client.get(`/analysis/order-book/${code}`, { market });
|
|
267
333
|
}
|
|
268
334
|
/**
|
|
269
|
-
* Get complete stock chart data
|
|
335
|
+
* Get complete stock chart data.
|
|
270
336
|
*/
|
|
271
337
|
async getChart(code, params) {
|
|
272
338
|
return this.client.get(`/analysis/chart/stock/${code}`, params);
|
|
273
339
|
}
|
|
274
340
|
/**
|
|
275
|
-
* Get
|
|
341
|
+
* Get historical index chart data.
|
|
342
|
+
*/
|
|
343
|
+
async getIndexChart(code, params) {
|
|
344
|
+
return this.client.get(`/analysis/chart/index/${code}`, params);
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Get stock chart with technical indicator.
|
|
276
348
|
*/
|
|
277
349
|
async getIndicatorChart(code, indicator, params) {
|
|
278
350
|
return this.client.get(`/analysis/chart/stock/${indicator}/${code}`, params);
|
|
279
351
|
}
|
|
280
352
|
/**
|
|
281
|
-
* Get shareholder detail
|
|
353
|
+
* Get shareholder detail above 5%.
|
|
282
354
|
*/
|
|
283
355
|
async getShareholderDetail(code) {
|
|
284
356
|
return this.client.get(`/analysis/shareholder-detail/${code}`);
|
|
285
357
|
}
|
|
286
358
|
/**
|
|
287
|
-
* Get
|
|
359
|
+
* Get shareholder detail above 1% for a specific holder.
|
|
360
|
+
*/
|
|
361
|
+
async getShareholderDetailOne(params) {
|
|
362
|
+
return this.client.get('/analysis/shareholder-detail-one', params);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Get number of shareholders.
|
|
288
366
|
*/
|
|
289
367
|
async getShareholderNumber(code) {
|
|
290
368
|
return this.client.get(`/analysis/shareholder/number/${code}`);
|
|
291
369
|
}
|
|
292
370
|
/**
|
|
293
|
-
* Get shareholder
|
|
371
|
+
* Get shareholder relation graph.
|
|
372
|
+
*/
|
|
373
|
+
async getShareholderRelation(params) {
|
|
374
|
+
return this.client.get('/analysis/shareholder/relation', params);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Get shareholder composition.
|
|
294
378
|
*/
|
|
295
379
|
async getShareholder(code) {
|
|
296
380
|
return this.client.get(`/analysis/shareholder/${code}`);
|
|
297
381
|
}
|
|
298
382
|
/**
|
|
299
|
-
* Get KSEI shareholder data
|
|
383
|
+
* Get KSEI shareholder data.
|
|
300
384
|
*/
|
|
301
385
|
async getShareholderKSEI(code, range) {
|
|
302
386
|
return this.client.get(`/analysis/shareholder/ksei/${code}`, {
|
|
@@ -304,87 +388,103 @@ class AnalysisEndpoints {
|
|
|
304
388
|
});
|
|
305
389
|
}
|
|
306
390
|
/**
|
|
307
|
-
* Get broker summary for a stock
|
|
391
|
+
* Get broker summary for a stock.
|
|
308
392
|
*/
|
|
309
393
|
async getBrokerSummaryStock(code, params) {
|
|
310
394
|
return this.client.get(`/analysis/summary/stock/${code}`, params);
|
|
311
395
|
}
|
|
312
396
|
/**
|
|
313
|
-
* Get broker summary for a broker
|
|
397
|
+
* Get broker summary for a broker.
|
|
314
398
|
*/
|
|
315
399
|
async getBrokerSummaryBroker(code, params) {
|
|
316
400
|
return this.client.get(`/analysis/summary/broker/${code}`, params);
|
|
317
401
|
}
|
|
318
402
|
/**
|
|
319
|
-
* Get
|
|
403
|
+
* Get sector stalker data.
|
|
404
|
+
*/
|
|
405
|
+
async getStalkerSector(params) {
|
|
406
|
+
return this.client.get('/analysis/stalker/sector', params);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Get sector rotation chart.
|
|
410
|
+
*/
|
|
411
|
+
async getSectorRotation(params) {
|
|
412
|
+
return this.client.get('/analysis/sector/rotation', params);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Get broker stalker data for a stock.
|
|
416
|
+
*/
|
|
417
|
+
async getBrokerStalker(broker, stock, params) {
|
|
418
|
+
return this.client.get(`/analysis/stalker/broker/${broker}/${stock}`, params);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Get broker stalker list.
|
|
422
|
+
*/
|
|
423
|
+
async getBrokerStalkerList(code, params) {
|
|
424
|
+
return this.client.get(`/analysis/stalker/list/${code}`, params);
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Get broker summary chart for a stock.
|
|
320
428
|
*/
|
|
321
429
|
async getBrokerSummaryChartStock(code, params) {
|
|
322
430
|
return this.client.get(`/analysis/summary-chart/stock/${code}`, params);
|
|
323
431
|
}
|
|
324
432
|
/**
|
|
325
|
-
* Get broker summary chart for a broker
|
|
433
|
+
* Get broker summary chart for a broker.
|
|
326
434
|
*/
|
|
327
435
|
async getBrokerSummaryChartBroker(code, params) {
|
|
328
436
|
return this.client.get(`/analysis/summary-chart/broker/${code}`, params);
|
|
329
437
|
}
|
|
330
438
|
/**
|
|
331
|
-
* Get inventory chart for a stock
|
|
439
|
+
* Get inventory chart for a stock.
|
|
332
440
|
*/
|
|
333
441
|
async getInventoryChartStock(code, params) {
|
|
334
|
-
|
|
335
|
-
if (params.filter) {
|
|
336
|
-
requestParams.filter = params.filter;
|
|
337
|
-
}
|
|
338
|
-
return this.client.get(`/analysis/inventory-chart/stock/${code}`, requestParams);
|
|
442
|
+
return this.client.get(`/analysis/inventory-chart/stock/${code}`, params);
|
|
339
443
|
}
|
|
340
444
|
/**
|
|
341
|
-
* Get inventory chart for a broker
|
|
445
|
+
* Get inventory chart for a broker.
|
|
342
446
|
*/
|
|
343
447
|
async getInventoryChartBroker(code, params) {
|
|
344
|
-
|
|
345
|
-
if (params.filter) {
|
|
346
|
-
requestParams.filter = params.filter;
|
|
347
|
-
}
|
|
348
|
-
return this.client.get(`/analysis/inventory-chart/broker/${code}`, requestParams);
|
|
448
|
+
return this.client.get(`/analysis/inventory-chart/broker/${code}`, params);
|
|
349
449
|
}
|
|
350
450
|
/**
|
|
351
|
-
* Get momentum chart
|
|
451
|
+
* Get momentum chart.
|
|
352
452
|
*/
|
|
353
453
|
async getMomentumChart(code, params) {
|
|
354
454
|
return this.client.get(`/analysis/momentum-chart/${code}`, params);
|
|
355
455
|
}
|
|
356
456
|
/**
|
|
357
|
-
* Get intraday inventory chart
|
|
457
|
+
* Get intraday inventory chart.
|
|
358
458
|
*/
|
|
359
459
|
async getIntradayInventoryChart(code, params) {
|
|
360
460
|
return this.client.get(`/analysis/intraday-inventory-chart/${code}`, params);
|
|
361
461
|
}
|
|
362
462
|
/**
|
|
363
|
-
* Get
|
|
463
|
+
* Get distribution or crossing chart.
|
|
364
464
|
*/
|
|
365
465
|
async getSankeyChart(code, params) {
|
|
366
466
|
return this.client.get(`/analysis/sankey-chart/${code}`, params);
|
|
367
467
|
}
|
|
368
468
|
/**
|
|
369
|
-
* Get price table
|
|
469
|
+
* Get price table.
|
|
370
470
|
*/
|
|
371
471
|
async getPriceTable(code, date) {
|
|
372
472
|
return this.client.get(`/analysis/price-table/${code}`, { date });
|
|
373
473
|
}
|
|
374
474
|
/**
|
|
375
|
-
* Get time table
|
|
475
|
+
* Get time table.
|
|
376
476
|
*/
|
|
377
477
|
async getTimeTable(code, params) {
|
|
378
478
|
return this.client.get(`/analysis/time-table/${code}`, params);
|
|
379
479
|
}
|
|
380
480
|
/**
|
|
381
|
-
* Get price diary
|
|
481
|
+
* Get price diary.
|
|
382
482
|
*/
|
|
383
483
|
async getPriceDiary(code) {
|
|
384
484
|
return this.client.get(`/analysis/price-diary/${code}`);
|
|
385
485
|
}
|
|
386
486
|
/**
|
|
387
|
-
* Get price seasonality
|
|
487
|
+
* Get price seasonality.
|
|
388
488
|
*/
|
|
389
489
|
async getPriceSeasonality(code, range) {
|
|
390
490
|
return this.client.get(`/analysis/price-seasonality/${code}`, {
|
|
@@ -392,43 +492,55 @@ class AnalysisEndpoints {
|
|
|
392
492
|
});
|
|
393
493
|
}
|
|
394
494
|
/**
|
|
395
|
-
* Get shareholders above 5
|
|
495
|
+
* Get shareholders above 5%.
|
|
396
496
|
*/
|
|
397
497
|
async getShareholderAbove(params) {
|
|
398
498
|
return this.client.get('/analysis/shareholder-above', params);
|
|
399
499
|
}
|
|
400
500
|
/**
|
|
401
|
-
* Get shareholder above 5% chart
|
|
501
|
+
* Get shareholder above 5% chart.
|
|
402
502
|
*/
|
|
403
503
|
async getShareholderAboveChart(code, params) {
|
|
404
504
|
return this.client.get(`/analysis/shareholder-above-chart/${code}`, params);
|
|
405
505
|
}
|
|
406
506
|
/**
|
|
407
|
-
* Get
|
|
507
|
+
* Get shareholders above 1%.
|
|
508
|
+
*/
|
|
509
|
+
async getShareholderOne(params) {
|
|
510
|
+
return this.client.get('/analysis/shareholder-one', params);
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Get shareholder above 1% chart.
|
|
514
|
+
*/
|
|
515
|
+
async getShareholderOneChart(code, params) {
|
|
516
|
+
return this.client.get(`/analysis/shareholder-one-chart/${code}`, params);
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Get insider trading data.
|
|
408
520
|
*/
|
|
409
521
|
async getInsiderTrading(params) {
|
|
410
522
|
return this.client.get('/analysis/shareholder-insider', params);
|
|
411
523
|
}
|
|
412
524
|
/**
|
|
413
|
-
* Get insider chart
|
|
525
|
+
* Get insider chart.
|
|
414
526
|
*/
|
|
415
527
|
async getInsiderChart(code, params) {
|
|
416
528
|
return this.client.get(`/analysis/insider-chart/${code}`, params);
|
|
417
529
|
}
|
|
418
530
|
/**
|
|
419
|
-
* Get financial statement
|
|
531
|
+
* Get financial statement.
|
|
420
532
|
*/
|
|
421
533
|
async getFinancialStatement(code, params) {
|
|
422
534
|
return this.client.get(`/analysis/financial-statement/${code}`, { ...params, limit: Math.min(params.limit, 20) });
|
|
423
535
|
}
|
|
424
536
|
/**
|
|
425
|
-
* Get financial statement chart
|
|
537
|
+
* Get financial statement chart.
|
|
426
538
|
*/
|
|
427
539
|
async getFinancialStatementChart(code, params) {
|
|
428
|
-
return this.client.get(`/analysis/financial-statement-chart/${code}`, { ...params, limit: Math.min(
|
|
540
|
+
return this.client.get(`/analysis/financial-statement-chart/${code}`, { ...params, limit: Math.min(params.limit, 20) });
|
|
429
541
|
}
|
|
430
542
|
/**
|
|
431
|
-
* Get key statistics
|
|
543
|
+
* Get key statistics.
|
|
432
544
|
*/
|
|
433
545
|
async getKeyStat(code, params) {
|
|
434
546
|
return this.client.get(`/analysis/keystat/${code}`, {
|
|
@@ -437,10 +549,25 @@ class AnalysisEndpoints {
|
|
|
437
549
|
});
|
|
438
550
|
}
|
|
439
551
|
/**
|
|
440
|
-
* Get key statistics chart
|
|
552
|
+
* Get key statistics chart.
|
|
441
553
|
*/
|
|
442
554
|
async getKeyStatChart(code, params) {
|
|
443
|
-
return this.client.get(`/analysis/keystat-chart/${code}`,
|
|
555
|
+
return this.client.get(`/analysis/keystat-chart/${code}`, {
|
|
556
|
+
...params,
|
|
557
|
+
limit: Math.min(params.limit, 20),
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Get corporate action calendar.
|
|
562
|
+
*/
|
|
563
|
+
async getCalendar(params) {
|
|
564
|
+
return this.client.get('/analysis/calendar', params);
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Alias for getCalendar.
|
|
568
|
+
*/
|
|
569
|
+
async getCorporateActionCalendar(params) {
|
|
570
|
+
return this.getCalendar(params);
|
|
444
571
|
}
|
|
445
572
|
}
|
|
446
573
|
|
|
@@ -449,43 +576,58 @@ class WatchlistsEndpoints {
|
|
|
449
576
|
this.client = client;
|
|
450
577
|
}
|
|
451
578
|
/**
|
|
452
|
-
* Get list of watchlists
|
|
579
|
+
* Get list of watchlists.
|
|
453
580
|
*/
|
|
454
|
-
async list(group) {
|
|
455
|
-
return this.client.get('/watchlists', { group
|
|
581
|
+
async list(group = 'null') {
|
|
582
|
+
return this.client.get('/watchlists', { group });
|
|
456
583
|
}
|
|
457
584
|
/**
|
|
458
|
-
* Add stock to watchlist
|
|
585
|
+
* Add stock to watchlist.
|
|
459
586
|
*/
|
|
460
587
|
async add(dto) {
|
|
461
588
|
return this.client.post('/watchlists', dto);
|
|
462
589
|
}
|
|
463
590
|
/**
|
|
464
|
-
* Delete watchlist
|
|
591
|
+
* Delete watchlist entries.
|
|
592
|
+
*
|
|
593
|
+
* The current OpenAPI spec does not describe delete filters,
|
|
594
|
+
* but the SDK keeps optional query params for batch deletion support.
|
|
465
595
|
*/
|
|
466
596
|
async delete(params) {
|
|
467
597
|
return this.client.delete('/watchlists', params);
|
|
468
598
|
}
|
|
469
599
|
/**
|
|
470
|
-
* Get list of watchlist groups
|
|
600
|
+
* Get list of watchlist groups.
|
|
471
601
|
*/
|
|
472
602
|
async listGroups() {
|
|
473
603
|
return this.client.get('/watchlists/group');
|
|
474
604
|
}
|
|
475
605
|
/**
|
|
476
|
-
* Add new watchlist group
|
|
606
|
+
* Add new watchlist group.
|
|
477
607
|
*/
|
|
478
608
|
async addGroup(dto) {
|
|
479
609
|
return this.client.post('/watchlists/group', dto);
|
|
480
610
|
}
|
|
481
611
|
/**
|
|
482
|
-
* Update watchlist
|
|
612
|
+
* Update watchlist group.
|
|
613
|
+
*/
|
|
614
|
+
async updateGroup(id, dto) {
|
|
615
|
+
return this.client.put(`/watchlists/group/${id}`, dto);
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Delete watchlist group.
|
|
619
|
+
*/
|
|
620
|
+
async deleteGroup(id) {
|
|
621
|
+
return this.client.delete(`/watchlists/group/${id}`);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Update watchlist.
|
|
483
625
|
*/
|
|
484
626
|
async update(id, dto) {
|
|
485
627
|
return this.client.put(`/watchlists/${id}`, dto);
|
|
486
628
|
}
|
|
487
629
|
/**
|
|
488
|
-
* Update watchlist note
|
|
630
|
+
* Update watchlist note.
|
|
489
631
|
*/
|
|
490
632
|
async updateNote(id, dto) {
|
|
491
633
|
return this.client.patch(`/watchlists/${id}`, dto);
|
|
@@ -497,56 +639,54 @@ class JournalsEndpoints {
|
|
|
497
639
|
this.client = client;
|
|
498
640
|
}
|
|
499
641
|
/**
|
|
500
|
-
* Extract journal from file
|
|
501
|
-
* Note: This method may need special handling depending on your environment
|
|
642
|
+
* Extract journal transactions from uploaded file.
|
|
502
643
|
*/
|
|
503
644
|
async extractFromFile(file) {
|
|
504
645
|
const formData = new FormData();
|
|
505
646
|
formData.append('file', file);
|
|
506
|
-
// Note: When using FormData, don't set Content-Type header
|
|
507
|
-
// Browser/Node will set it automatically with boundary
|
|
508
|
-
const controller = new AbortController();
|
|
509
647
|
const url = `${this.client.baseURL}/journals/file`;
|
|
510
648
|
const response = await fetch(url, {
|
|
511
649
|
method: 'POST',
|
|
512
650
|
headers: {
|
|
513
|
-
|
|
651
|
+
Authorization: `Bearer ${this.client.apiKey}`,
|
|
514
652
|
},
|
|
515
653
|
body: formData,
|
|
516
|
-
signal: controller.signal,
|
|
517
654
|
});
|
|
518
655
|
if (!response.ok) {
|
|
519
|
-
const data = await response.json().catch(() => ({}));
|
|
520
|
-
throw new
|
|
656
|
+
const data = (await response.json().catch(() => ({})));
|
|
657
|
+
throw new InvezgoError(response.status, data.message || 'Failed to extract journal from file', data.error, data);
|
|
521
658
|
}
|
|
522
659
|
return response.json().catch(() => ({}));
|
|
523
660
|
}
|
|
524
661
|
/**
|
|
525
|
-
* Add new journal transaction
|
|
662
|
+
* Add new journal transaction.
|
|
526
663
|
*/
|
|
527
664
|
async add(dto) {
|
|
528
665
|
return this.client.post('/journals', dto);
|
|
529
666
|
}
|
|
530
667
|
/**
|
|
531
|
-
* List journal transactions
|
|
668
|
+
* List journal transactions.
|
|
532
669
|
*/
|
|
533
670
|
async list() {
|
|
534
671
|
return this.client.get('/journals');
|
|
535
672
|
}
|
|
536
673
|
/**
|
|
537
|
-
* Delete journal
|
|
674
|
+
* Delete journal entries.
|
|
675
|
+
*
|
|
676
|
+
* The current OpenAPI spec does not describe delete filters,
|
|
677
|
+
* but the SDK keeps optional query params for batch deletion support.
|
|
538
678
|
*/
|
|
539
679
|
async delete(params) {
|
|
540
680
|
return this.client.delete('/journals', params);
|
|
541
681
|
}
|
|
542
682
|
/**
|
|
543
|
-
* Get journal transactions summary
|
|
683
|
+
* Get journal transactions summary.
|
|
544
684
|
*/
|
|
545
685
|
async getSummary() {
|
|
546
686
|
return this.client.get('/journals/summary');
|
|
547
687
|
}
|
|
548
688
|
/**
|
|
549
|
-
* Update journal transaction note
|
|
689
|
+
* Update journal transaction note.
|
|
550
690
|
*/
|
|
551
691
|
async updateNote(id, dto) {
|
|
552
692
|
return this.client.patch(`/journals/${id}`, dto);
|
|
@@ -571,78 +711,6 @@ class PortfoliosEndpoints {
|
|
|
571
711
|
}
|
|
572
712
|
}
|
|
573
713
|
|
|
574
|
-
class AiEndpoints {
|
|
575
|
-
constructor(client) {
|
|
576
|
-
this.client = client;
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* AI analysis of KSEI shareholder data
|
|
580
|
-
*/
|
|
581
|
-
async analyzeShareholderKSEI(code) {
|
|
582
|
-
return this.client.get(`/ai/shareholder/ksei/${code}`);
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* AI analysis of inventory chart
|
|
586
|
-
*/
|
|
587
|
-
async analyzeInventoryChart(code, params) {
|
|
588
|
-
return this.client.get(`/ai/inventory-chart/stock/${code}`, params);
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* AI analysis of stock news
|
|
592
|
-
*/
|
|
593
|
-
async analyzeNews(code) {
|
|
594
|
-
return this.client.get(`/ai/news/${code}`);
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* AI analysis of broker summary
|
|
598
|
-
*/
|
|
599
|
-
async analyzeBrokerSummary(code, params) {
|
|
600
|
-
return this.client.get(`/ai/summary/stock/${code}`, params);
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* AI analysis of insider trading
|
|
604
|
-
*/
|
|
605
|
-
async analyzeInsider(params) {
|
|
606
|
-
return this.client.get('/ai/shareholder-insider', params);
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* AI analysis of shareholders above 5%
|
|
610
|
-
*/
|
|
611
|
-
async analyzeShareholderAbove(params) {
|
|
612
|
-
return this.client.get('/ai/shareholder-above', params);
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* AI analysis of intraday inventory chart
|
|
616
|
-
*/
|
|
617
|
-
async analyzeIntradayInventory(code, params) {
|
|
618
|
-
return this.client.get(`/ai/intraday-inventory-chart/${code}`, params);
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* AI analysis of sankey/crossing chart
|
|
622
|
-
*/
|
|
623
|
-
async analyzeSankeyChart(code, params) {
|
|
624
|
-
return this.client.get(`/ai/sankey-chart/${code}`, params);
|
|
625
|
-
}
|
|
626
|
-
/**
|
|
627
|
-
* AI analysis of shareholder table
|
|
628
|
-
*/
|
|
629
|
-
async analyzeShareholder(code) {
|
|
630
|
-
return this.client.get(`/ai/shareholder/${code}`);
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* AI analysis of financial statement
|
|
634
|
-
*/
|
|
635
|
-
async analyzeFinancialStatement(code, params) {
|
|
636
|
-
return this.client.get(`/ai/financial-statement/${code}`, params);
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* AI analysis of key statistics
|
|
640
|
-
*/
|
|
641
|
-
async analyzeKeyStat(code, params) {
|
|
642
|
-
return this.client.get(`/ai/keystat/${code}`, params);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
|
|
646
714
|
class SearchEndpoints {
|
|
647
715
|
constructor(client) {
|
|
648
716
|
this.client = client;
|
|
@@ -720,37 +788,37 @@ class MembershipEndpoints {
|
|
|
720
788
|
this.client = client;
|
|
721
789
|
}
|
|
722
790
|
/**
|
|
723
|
-
* Get list of memberships
|
|
791
|
+
* Get list of memberships.
|
|
724
792
|
*/
|
|
725
793
|
async list() {
|
|
726
794
|
return this.client.get('/membership');
|
|
727
795
|
}
|
|
728
796
|
/**
|
|
729
|
-
* Add new membership
|
|
797
|
+
* Add new membership.
|
|
730
798
|
*/
|
|
731
799
|
async add(dto) {
|
|
732
800
|
return this.client.post('/membership', dto);
|
|
733
801
|
}
|
|
734
802
|
/**
|
|
735
|
-
* Get membership
|
|
803
|
+
* Get membership scopes.
|
|
736
804
|
*/
|
|
737
805
|
async getScope() {
|
|
738
806
|
return this.client.get('/membership/scope');
|
|
739
807
|
}
|
|
740
808
|
/**
|
|
741
|
-
* Get membership transactions
|
|
809
|
+
* Get membership transactions.
|
|
742
810
|
*/
|
|
743
811
|
async getTransactions() {
|
|
744
812
|
return this.client.get('/membership/list');
|
|
745
813
|
}
|
|
746
814
|
/**
|
|
747
|
-
* Update membership
|
|
815
|
+
* Update membership.
|
|
748
816
|
*/
|
|
749
817
|
async update(id, dto) {
|
|
750
818
|
return this.client.put(`/membership/${id}`, dto);
|
|
751
819
|
}
|
|
752
820
|
/**
|
|
753
|
-
* Delete membership
|
|
821
|
+
* Delete membership.
|
|
754
822
|
*/
|
|
755
823
|
async delete(id) {
|
|
756
824
|
return this.client.delete(`/membership/${id}`);
|
|
@@ -817,6 +885,18 @@ class PostsEndpoints {
|
|
|
817
885
|
}
|
|
818
886
|
}
|
|
819
887
|
|
|
888
|
+
class RecommendationEndpoints {
|
|
889
|
+
constructor(client) {
|
|
890
|
+
this.client = client;
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Get user recommendations.
|
|
894
|
+
*/
|
|
895
|
+
async getUserRecommendations() {
|
|
896
|
+
return this.client.get('/recommendation/user');
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
820
900
|
class TradesEndpoints {
|
|
821
901
|
constructor(client) {
|
|
822
902
|
this.client = client;
|
|
@@ -858,74 +938,61 @@ class ScreenerEndpoints {
|
|
|
858
938
|
this.client = client;
|
|
859
939
|
}
|
|
860
940
|
/**
|
|
861
|
-
* Get list of preset screeners
|
|
941
|
+
* Get list of preset screeners.
|
|
862
942
|
*/
|
|
863
943
|
async list() {
|
|
864
944
|
return this.client.get('/screener');
|
|
865
945
|
}
|
|
866
946
|
/**
|
|
867
|
-
* Save preset screener
|
|
947
|
+
* Save preset screener.
|
|
868
948
|
*/
|
|
869
949
|
async save(dto) {
|
|
870
950
|
return this.client.post('/screener', dto);
|
|
871
951
|
}
|
|
872
952
|
/**
|
|
873
|
-
*
|
|
874
|
-
*/
|
|
875
|
-
async screen(dto) {
|
|
876
|
-
return this.client.post('/screener/screen', dto);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
class HealthEndpoints {
|
|
881
|
-
constructor(client) {
|
|
882
|
-
this.client = client;
|
|
883
|
-
}
|
|
884
|
-
/**
|
|
885
|
-
* Check API status
|
|
953
|
+
* Update preset screener.
|
|
886
954
|
*/
|
|
887
|
-
async
|
|
888
|
-
return this.client.
|
|
955
|
+
async update(id, dto) {
|
|
956
|
+
return this.client.put(`/screener/${id}`, dto);
|
|
889
957
|
}
|
|
890
958
|
/**
|
|
891
|
-
*
|
|
959
|
+
* Delete preset screener.
|
|
892
960
|
*/
|
|
893
|
-
async
|
|
894
|
-
return this.client.
|
|
961
|
+
async delete(id) {
|
|
962
|
+
return this.client.delete(`/screener/${id}`);
|
|
895
963
|
}
|
|
896
964
|
/**
|
|
897
|
-
*
|
|
965
|
+
* Run screener.
|
|
898
966
|
*/
|
|
899
|
-
async
|
|
900
|
-
return this.client.
|
|
967
|
+
async screen(dto) {
|
|
968
|
+
return this.client.post('/screener/screen', dto);
|
|
901
969
|
}
|
|
902
970
|
}
|
|
903
971
|
|
|
904
972
|
class Invezgo {
|
|
905
973
|
constructor(config) {
|
|
906
974
|
this.client = new HttpClient(config);
|
|
907
|
-
|
|
975
|
+
this.alerts = new AlertsEndpoints(this.client);
|
|
908
976
|
this.analysis = new AnalysisEndpoints(this.client);
|
|
909
977
|
this.watchlists = new WatchlistsEndpoints(this.client);
|
|
910
978
|
this.journals = new JournalsEndpoints(this.client);
|
|
911
979
|
this.portfolios = new PortfoliosEndpoints(this.client);
|
|
912
|
-
this.ai = new AiEndpoints(this.client);
|
|
913
980
|
this.search = new SearchEndpoints(this.client);
|
|
914
981
|
this.profile = new ProfileEndpoints(this.client);
|
|
915
982
|
this.membership = new MembershipEndpoints(this.client);
|
|
916
983
|
this.posts = new PostsEndpoints(this.client);
|
|
984
|
+
this.recommendation = new RecommendationEndpoints(this.client);
|
|
917
985
|
this.trades = new TradesEndpoints(this.client);
|
|
918
986
|
this.screener = new ScreenerEndpoints(this.client);
|
|
919
|
-
this.health = new HealthEndpoints(this.client);
|
|
920
987
|
}
|
|
921
988
|
/**
|
|
922
|
-
* Update API key
|
|
989
|
+
* Update API key.
|
|
923
990
|
*/
|
|
924
991
|
setApiKey(apiKey) {
|
|
925
992
|
this.client.apiKey = apiKey;
|
|
926
993
|
}
|
|
927
994
|
/**
|
|
928
|
-
*
|
|
995
|
+
* Check whether an API key is currently configured.
|
|
929
996
|
*/
|
|
930
997
|
hasApiKey() {
|
|
931
998
|
return !!this.client.apiKey;
|
|
@@ -933,12 +1000,12 @@ class Invezgo {
|
|
|
933
1000
|
}
|
|
934
1001
|
|
|
935
1002
|
/**
|
|
936
|
-
* Invezgo SDK for JavaScript and TypeScript
|
|
1003
|
+
* Invezgo SDK for JavaScript and TypeScript.
|
|
937
1004
|
*
|
|
938
|
-
* Official SDK for accessing Invezgo API
|
|
1005
|
+
* Official SDK for accessing Invezgo API.
|
|
939
1006
|
*
|
|
940
1007
|
* @packageDocumentation
|
|
941
1008
|
*/
|
|
942
1009
|
|
|
943
|
-
export { Invezgo, InvezgoError, JournalsEndpoints, MembershipEndpoints, ScreenerEndpoints, TradesEndpoints, WatchlistsEndpoints, Invezgo as default };
|
|
1010
|
+
export { AlertsEndpoints, Invezgo, InvezgoError, JournalsEndpoints, MembershipEndpoints, RecommendationEndpoints, ScreenerEndpoints, TradesEndpoints, WatchlistsEndpoints, Invezgo as default };
|
|
944
1011
|
//# sourceMappingURL=index.js.map
|