@invezgo/sdk 1.0.1 → 1.3.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/dist/index.esm.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 complete company information
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 (bandarmologi)
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 intraday chart data
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 order book data
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 stock chart with technical indicator
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 (ownership)
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 number of shareholders
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 composition
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 broker summary chart for a stock
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
- const requestParams = { ...params };
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
- const requestParams = { ...params };
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 sankey/crossing chart
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 insider trading data
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(Number(params.limit), 20).toString() });
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,49 @@ 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}`, params);
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);
571
+ }
572
+ /**
573
+ * Get multi-timeframe chart data for stocks or indexes.
574
+ */
575
+ async getMultiTimeChart(code, params) {
576
+ return this.client.get(`/analysis/chart/multi-time/${code}`, params);
577
+ }
578
+ /**
579
+ * Get high concentration stock ownership data for all issuers.
580
+ */
581
+ async getShareholderHigh() {
582
+ return this.client.get('/analysis/shareholder/high');
583
+ }
584
+ /**
585
+ * Get complete shareholder data with all investor classifications for a specific period.
586
+ */
587
+ async getShareholderClassification(code, range) {
588
+ return this.client.get(`/analysis/shareholder/classification/${code}`, { range: Math.min(range, 36) });
589
+ }
590
+ /**
591
+ * Get latest shareholder data with investor classifications in table format.
592
+ */
593
+ async getShareholderClassifyTable(code) {
594
+ return this.client.get(`/analysis/shareholder/classify-table/${code}`);
444
595
  }
445
596
  }
446
597
 
@@ -449,43 +600,58 @@ class WatchlistsEndpoints {
449
600
  this.client = client;
450
601
  }
451
602
  /**
452
- * Get list of watchlists
603
+ * Get list of watchlists.
453
604
  */
454
- async list(group) {
455
- return this.client.get('/watchlists', { group: group || 'null' });
605
+ async list(group = 'null') {
606
+ return this.client.get('/watchlists', { group });
456
607
  }
457
608
  /**
458
- * Add stock to watchlist
609
+ * Add stock to watchlist.
459
610
  */
460
611
  async add(dto) {
461
612
  return this.client.post('/watchlists', dto);
462
613
  }
463
614
  /**
464
- * Delete watchlist
615
+ * Delete watchlist entries.
616
+ *
617
+ * The current OpenAPI spec does not describe delete filters,
618
+ * but the SDK keeps optional query params for batch deletion support.
465
619
  */
466
620
  async delete(params) {
467
621
  return this.client.delete('/watchlists', params);
468
622
  }
469
623
  /**
470
- * Get list of watchlist groups
624
+ * Get list of watchlist groups.
471
625
  */
472
626
  async listGroups() {
473
627
  return this.client.get('/watchlists/group');
474
628
  }
475
629
  /**
476
- * Add new watchlist group
630
+ * Add new watchlist group.
477
631
  */
478
632
  async addGroup(dto) {
479
633
  return this.client.post('/watchlists/group', dto);
480
634
  }
481
635
  /**
482
- * Update watchlist
636
+ * Update watchlist group.
637
+ */
638
+ async updateGroup(id, dto) {
639
+ return this.client.put(`/watchlists/group/${id}`, dto);
640
+ }
641
+ /**
642
+ * Delete watchlist group.
643
+ */
644
+ async deleteGroup(id) {
645
+ return this.client.delete(`/watchlists/group/${id}`);
646
+ }
647
+ /**
648
+ * Update watchlist.
483
649
  */
484
650
  async update(id, dto) {
485
651
  return this.client.put(`/watchlists/${id}`, dto);
486
652
  }
487
653
  /**
488
- * Update watchlist note
654
+ * Update watchlist note.
489
655
  */
490
656
  async updateNote(id, dto) {
491
657
  return this.client.patch(`/watchlists/${id}`, dto);
@@ -497,56 +663,54 @@ class JournalsEndpoints {
497
663
  this.client = client;
498
664
  }
499
665
  /**
500
- * Extract journal from file
501
- * Note: This method may need special handling depending on your environment
666
+ * Extract journal transactions from uploaded file.
502
667
  */
503
668
  async extractFromFile(file) {
504
669
  const formData = new FormData();
505
670
  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
671
  const url = `${this.client.baseURL}/journals/file`;
510
672
  const response = await fetch(url, {
511
673
  method: 'POST',
512
674
  headers: {
513
- 'Authorization': `Bearer ${this.client.apiKey}`,
675
+ Authorization: `Bearer ${this.client.apiKey}`,
514
676
  },
515
677
  body: formData,
516
- signal: controller.signal,
517
678
  });
518
679
  if (!response.ok) {
519
- const data = await response.json().catch(() => ({}));
520
- throw new Error(data?.message || 'Failed to extract journal from file');
680
+ const data = (await response.json().catch(() => ({})));
681
+ throw new InvezgoError(response.status, data.message || 'Failed to extract journal from file', data.error, data);
521
682
  }
522
683
  return response.json().catch(() => ({}));
523
684
  }
524
685
  /**
525
- * Add new journal transaction
686
+ * Add new journal transaction.
526
687
  */
527
688
  async add(dto) {
528
689
  return this.client.post('/journals', dto);
529
690
  }
530
691
  /**
531
- * List journal transactions
692
+ * List journal transactions.
532
693
  */
533
694
  async list() {
534
695
  return this.client.get('/journals');
535
696
  }
536
697
  /**
537
- * Delete journal
698
+ * Delete journal entries.
699
+ *
700
+ * The current OpenAPI spec does not describe delete filters,
701
+ * but the SDK keeps optional query params for batch deletion support.
538
702
  */
539
703
  async delete(params) {
540
704
  return this.client.delete('/journals', params);
541
705
  }
542
706
  /**
543
- * Get journal transactions summary
707
+ * Get journal transactions summary.
544
708
  */
545
709
  async getSummary() {
546
710
  return this.client.get('/journals/summary');
547
711
  }
548
712
  /**
549
- * Update journal transaction note
713
+ * Update journal transaction note.
550
714
  */
551
715
  async updateNote(id, dto) {
552
716
  return this.client.patch(`/journals/${id}`, dto);
@@ -571,78 +735,6 @@ class PortfoliosEndpoints {
571
735
  }
572
736
  }
573
737
 
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
738
  class SearchEndpoints {
647
739
  constructor(client) {
648
740
  this.client = client;
@@ -720,37 +812,37 @@ class MembershipEndpoints {
720
812
  this.client = client;
721
813
  }
722
814
  /**
723
- * Get list of memberships
815
+ * Get list of memberships.
724
816
  */
725
817
  async list() {
726
818
  return this.client.get('/membership');
727
819
  }
728
820
  /**
729
- * Add new membership
821
+ * Add new membership.
730
822
  */
731
823
  async add(dto) {
732
824
  return this.client.post('/membership', dto);
733
825
  }
734
826
  /**
735
- * Get membership scope
827
+ * Get membership scopes.
736
828
  */
737
829
  async getScope() {
738
830
  return this.client.get('/membership/scope');
739
831
  }
740
832
  /**
741
- * Get membership transactions
833
+ * Get membership transactions.
742
834
  */
743
835
  async getTransactions() {
744
836
  return this.client.get('/membership/list');
745
837
  }
746
838
  /**
747
- * Update membership
839
+ * Update membership.
748
840
  */
749
841
  async update(id, dto) {
750
842
  return this.client.put(`/membership/${id}`, dto);
751
843
  }
752
844
  /**
753
- * Delete membership
845
+ * Delete membership.
754
846
  */
755
847
  async delete(id) {
756
848
  return this.client.delete(`/membership/${id}`);
@@ -817,6 +909,18 @@ class PostsEndpoints {
817
909
  }
818
910
  }
819
911
 
912
+ class RecommendationEndpoints {
913
+ constructor(client) {
914
+ this.client = client;
915
+ }
916
+ /**
917
+ * Get user recommendations.
918
+ */
919
+ async getUserRecommendations() {
920
+ return this.client.get('/recommendation/user');
921
+ }
922
+ }
923
+
820
924
  class TradesEndpoints {
821
925
  constructor(client) {
822
926
  this.client = client;
@@ -858,74 +962,74 @@ class ScreenerEndpoints {
858
962
  this.client = client;
859
963
  }
860
964
  /**
861
- * Get list of preset screeners
965
+ * Get list of preset screeners.
862
966
  */
863
967
  async list() {
864
968
  return this.client.get('/screener');
865
969
  }
866
970
  /**
867
- * Save preset screener
971
+ * Save preset screener.
868
972
  */
869
973
  async save(dto) {
870
974
  return this.client.post('/screener', dto);
871
975
  }
872
976
  /**
873
- * Run screener
977
+ * Update preset screener.
978
+ */
979
+ async update(id, dto) {
980
+ return this.client.put(`/screener/${id}`, dto);
981
+ }
982
+ /**
983
+ * Delete preset screener.
984
+ */
985
+ async delete(id) {
986
+ return this.client.delete(`/screener/${id}`);
987
+ }
988
+ /**
989
+ * Run screener.
874
990
  */
875
991
  async screen(dto) {
876
992
  return this.client.post('/screener/screen', dto);
877
993
  }
878
994
  }
879
995
 
880
- class HealthEndpoints {
996
+ class UsageEndpoints {
881
997
  constructor(client) {
882
998
  this.client = client;
883
999
  }
884
1000
  /**
885
- * Check API status
886
- */
887
- async check() {
888
- return this.client.get('/health');
889
- }
890
- /**
891
- * Check database status
892
- */
893
- async checkDatabase() {
894
- return this.client.get('/health/database');
895
- }
896
- /**
897
- * Full health check (API and database)
1001
+ * Get API usage statistics for the configured API key.
898
1002
  */
899
- async fullCheck() {
900
- return this.client.get('/health/full');
1003
+ async getApiUsage() {
1004
+ return this.client.get('/usage/api');
901
1005
  }
902
1006
  }
903
1007
 
904
1008
  class Invezgo {
905
1009
  constructor(config) {
906
1010
  this.client = new HttpClient(config);
907
- // Initialize all endpoint modules
1011
+ this.alerts = new AlertsEndpoints(this.client);
908
1012
  this.analysis = new AnalysisEndpoints(this.client);
909
1013
  this.watchlists = new WatchlistsEndpoints(this.client);
910
1014
  this.journals = new JournalsEndpoints(this.client);
911
1015
  this.portfolios = new PortfoliosEndpoints(this.client);
912
- this.ai = new AiEndpoints(this.client);
913
1016
  this.search = new SearchEndpoints(this.client);
914
1017
  this.profile = new ProfileEndpoints(this.client);
915
1018
  this.membership = new MembershipEndpoints(this.client);
916
1019
  this.posts = new PostsEndpoints(this.client);
1020
+ this.recommendation = new RecommendationEndpoints(this.client);
917
1021
  this.trades = new TradesEndpoints(this.client);
918
1022
  this.screener = new ScreenerEndpoints(this.client);
919
- this.health = new HealthEndpoints(this.client);
1023
+ this.usage = new UsageEndpoints(this.client);
920
1024
  }
921
1025
  /**
922
- * Update API key
1026
+ * Update API key.
923
1027
  */
924
1028
  setApiKey(apiKey) {
925
1029
  this.client.apiKey = apiKey;
926
1030
  }
927
1031
  /**
928
- * Get current API key (without exposing it)
1032
+ * Check whether an API key is currently configured.
929
1033
  */
930
1034
  hasApiKey() {
931
1035
  return !!this.client.apiKey;
@@ -933,12 +1037,12 @@ class Invezgo {
933
1037
  }
934
1038
 
935
1039
  /**
936
- * Invezgo SDK for JavaScript and TypeScript
1040
+ * Invezgo SDK for JavaScript and TypeScript.
937
1041
  *
938
- * Official SDK for accessing Invezgo API - Indonesia Stock Market Data
1042
+ * Official SDK for accessing Invezgo API.
939
1043
  *
940
1044
  * @packageDocumentation
941
1045
  */
942
1046
 
943
- export { Invezgo, InvezgoError, JournalsEndpoints, MembershipEndpoints, ScreenerEndpoints, TradesEndpoints, WatchlistsEndpoints, Invezgo as default };
1047
+ export { AlertsEndpoints, Invezgo, InvezgoError, JournalsEndpoints, MembershipEndpoints, RecommendationEndpoints, ScreenerEndpoints, TradesEndpoints, UsageEndpoints, WatchlistsEndpoints, Invezgo as default };
944
1048
  //# sourceMappingURL=index.esm.js.map