reportify-sdk 0.3.7 → 0.3.9

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 CHANGED
@@ -48,11 +48,8 @@ const income = await client.stock.incomeStatement('AAPL', { period: 'quarterly'
48
48
  const balance = await client.stock.balanceSheet('AAPL');
49
49
  const cashflow = await client.stock.cashflowStatement('AAPL');
50
50
 
51
- // Price data
52
- const prices = await client.stock.prices('AAPL', { startDate: '2024-01-01' });
53
-
54
- // Real-time quote
55
- const quote = await client.stock.quote('AAPL');
51
+ // Stock quote (price data)
52
+ const quote = await client.stock.quote('AAPL', { startDate: '2024-01-01' });
56
53
 
57
54
  // Company info (symbols without market prefix)
58
55
  const overview = await client.stock.overview({ symbols: 'AAPL' });
@@ -101,19 +98,19 @@ const result = await client.docs.uploadDocs([
101
98
 
102
99
  ```typescript
103
100
  // Compute technical indicators
104
- const rsi = await client.quant.computeIndicators({
101
+ const rsi = await client.quant.indicatorsCompute({
105
102
  symbols: ['000001'],
106
103
  formula: 'RSI(14)'
107
104
  });
108
105
 
109
- const macd = await client.quant.computeIndicators({
106
+ const macd = await client.quant.indicatorsCompute({
110
107
  symbols: ['000001'],
111
108
  formula: 'MACD()'
112
109
  });
113
110
 
114
111
  // Screen stocks by formula
115
- const oversold = await client.quant.screen({ formula: 'RSI(14) < 30' });
116
- const goldenCross = await client.quant.screen({ formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))' });
112
+ const oversold = await client.quant.factorsScreen({ formula: 'RSI(14) < 30' });
113
+ const goldenCross = await client.quant.factorsScreen({ formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 20))' });
117
114
 
118
115
  // Get OHLCV data
119
116
  const ohlcv = await client.quant.ohlcv({ symbol: '000001', startDate: '2024-01-01' });
package/dist/index.d.mts CHANGED
@@ -399,28 +399,22 @@ declare class StockModule {
399
399
  fiscalYear?: string;
400
400
  }): Promise<FinancialStatement[]>;
401
401
  /**
402
- * Get historical stock prices
402
+ * Get stock quote - current and historical prices with market data
403
403
  *
404
404
  * @param symbol - Stock symbol
405
405
  * @param options - Query options
406
406
  */
407
- prices(symbol: string, options?: {
407
+ quote(symbol: string, options?: {
408
408
  startDate?: string;
409
409
  endDate?: string;
410
410
  }): Promise<PriceData[]>;
411
411
  /**
412
- * Get real-time stock quote
413
- *
414
- * @param symbol - Stock symbol
415
- */
416
- quote(symbol: string): Promise<Quote>;
417
- /**
418
- * Get stock index prices
412
+ * Get stock index quote
419
413
  *
420
414
  * @param symbol - Index symbol (e.g., HSI, SPX, DJI)
421
415
  * @param options - Query options
422
416
  */
423
- indexPrices(symbol: string, options?: {
417
+ indexQuote(symbol: string, options?: {
424
418
  startDate?: string;
425
419
  endDate?: string;
426
420
  }): Promise<PriceData[]>;
@@ -763,13 +757,13 @@ interface BacktestResult {
763
757
  * @example
764
758
  * ```typescript
765
759
  * // Compute RSI indicator
766
- * const data = await client.quant.computeIndicators({
760
+ * const data = await client.quant.indicatorsCompute({
767
761
  * symbols: ['000001'],
768
762
  * formula: 'RSI(14)'
769
763
  * });
770
764
  *
771
765
  * // Screen stocks by formula
772
- * const stocks = await client.quant.screen({
766
+ * const stocks = await client.quant.factorsScreen({
773
767
  * formula: 'RSI(14) < 30'
774
768
  * });
775
769
  * ```
@@ -786,14 +780,14 @@ declare class QuantModule {
786
780
  *
787
781
  * @example
788
782
  * ```typescript
789
- * const indicators = await client.quant.listIndicators();
783
+ * const indicators = await client.quant.indicators();
790
784
  * indicators.forEach(ind => {
791
785
  * console.log(`${ind.name}: ${ind.description}`);
792
786
  * console.log(` Fields: ${ind.fields.join(', ')}`);
793
787
  * });
794
788
  * ```
795
789
  */
796
- listIndicators(): Promise<IndicatorMeta[]>;
790
+ indicators(): Promise<IndicatorMeta[]>;
797
791
  /**
798
792
  * Compute indicator values for given symbols
799
793
  *
@@ -807,25 +801,25 @@ declare class QuantModule {
807
801
  * @example
808
802
  * ```typescript
809
803
  * // RSI indicator
810
- * const data = await client.quant.computeIndicators({
804
+ * const data = await client.quant.indicatorsCompute({
811
805
  * symbols: ['000001'],
812
806
  * formula: 'RSI(14)'
813
807
  * });
814
808
  *
815
809
  * // MACD indicator
816
- * const data = await client.quant.computeIndicators({
810
+ * const data = await client.quant.indicatorsCompute({
817
811
  * symbols: ['000001'],
818
812
  * formula: 'MACD()'
819
813
  * });
820
814
  *
821
815
  * // Standard deviation
822
- * const data = await client.quant.computeIndicators({
816
+ * const data = await client.quant.indicatorsCompute({
823
817
  * symbols: ['000001'],
824
818
  * formula: 'STD(CLOSE, 20)'
825
819
  * });
826
820
  * ```
827
821
  */
828
- computeIndicators(params: IndicatorComputeParams): Promise<IndicatorData[]>;
822
+ indicatorsCompute(params: IndicatorComputeParams): Promise<IndicatorData[]>;
829
823
  /**
830
824
  * Get list of available factors (variables and functions)
831
825
  *
@@ -835,7 +829,7 @@ declare class QuantModule {
835
829
  *
836
830
  * @returns Array of factor definitions organized by level
837
831
  */
838
- listFactors(): Promise<FactorMeta[]>;
832
+ factors(): Promise<FactorMeta[]>;
839
833
  /**
840
834
  * Compute factor values for given symbols
841
835
  *
@@ -851,31 +845,31 @@ declare class QuantModule {
851
845
  * @example
852
846
  * ```typescript
853
847
  * // Simple indicator
854
- * const data = await client.quant.computeFactors({
848
+ * const data = await client.quant.factorsCompute({
855
849
  * symbols: ['000001'],
856
850
  * formula: 'RSI(14)'
857
851
  * });
858
852
  *
859
853
  * // MACD DIF line
860
- * const data = await client.quant.computeFactors({
854
+ * const data = await client.quant.factorsCompute({
861
855
  * symbols: ['000001'],
862
856
  * formula: 'MACD().dif'
863
857
  * });
864
858
  *
865
859
  * // Close above 20-day MA
866
- * const data = await client.quant.computeFactors({
860
+ * const data = await client.quant.factorsCompute({
867
861
  * symbols: ['000001'],
868
862
  * formula: 'CLOSE > MA(CLOSE, 20)'
869
863
  * });
870
864
  *
871
865
  * // Fundamental factors (note: functions require parentheses)
872
- * const data = await client.quant.computeFactors({
866
+ * const data = await client.quant.factorsCompute({
873
867
  * symbols: ['000001'],
874
868
  * formula: 'PE()'
875
869
  * });
876
870
  * ```
877
871
  */
878
- computeFactors(params: FactorComputeParams): Promise<IndicatorData[]>;
872
+ factorsCompute(params: FactorComputeParams): Promise<IndicatorData[]>;
879
873
  /**
880
874
  * Screen stocks based on factor formula
881
875
  *
@@ -889,27 +883,27 @@ declare class QuantModule {
889
883
  * @example
890
884
  * ```typescript
891
885
  * // RSI oversold
892
- * const stocks = await client.quant.screen({
886
+ * const stocks = await client.quant.factorsScreen({
893
887
  * formula: 'RSI(14) < 30'
894
888
  * });
895
889
  *
896
890
  * // Golden cross
897
- * const stocks = await client.quant.screen({
891
+ * const stocks = await client.quant.factorsScreen({
898
892
  * formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
899
893
  * });
900
894
  *
901
895
  * // Uptrend
902
- * const stocks = await client.quant.screen({
896
+ * const stocks = await client.quant.factorsScreen({
903
897
  * formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
904
898
  * });
905
899
  *
906
900
  * // Fundamental screening (note: functions require parentheses)
907
- * const stocks = await client.quant.screen({
901
+ * const stocks = await client.quant.factorsScreen({
908
902
  * formula: '(PE() < 20) & (ROE() > 0.15)'
909
903
  * });
910
904
  * ```
911
905
  */
912
- screen(params: ScreenParams): Promise<ScreenedStock[]>;
906
+ factorsScreen(params: ScreenParams): Promise<ScreenedStock[]>;
913
907
  /**
914
908
  * Get OHLCV daily data for a single symbol
915
909
  *
package/dist/index.d.ts CHANGED
@@ -399,28 +399,22 @@ declare class StockModule {
399
399
  fiscalYear?: string;
400
400
  }): Promise<FinancialStatement[]>;
401
401
  /**
402
- * Get historical stock prices
402
+ * Get stock quote - current and historical prices with market data
403
403
  *
404
404
  * @param symbol - Stock symbol
405
405
  * @param options - Query options
406
406
  */
407
- prices(symbol: string, options?: {
407
+ quote(symbol: string, options?: {
408
408
  startDate?: string;
409
409
  endDate?: string;
410
410
  }): Promise<PriceData[]>;
411
411
  /**
412
- * Get real-time stock quote
413
- *
414
- * @param symbol - Stock symbol
415
- */
416
- quote(symbol: string): Promise<Quote>;
417
- /**
418
- * Get stock index prices
412
+ * Get stock index quote
419
413
  *
420
414
  * @param symbol - Index symbol (e.g., HSI, SPX, DJI)
421
415
  * @param options - Query options
422
416
  */
423
- indexPrices(symbol: string, options?: {
417
+ indexQuote(symbol: string, options?: {
424
418
  startDate?: string;
425
419
  endDate?: string;
426
420
  }): Promise<PriceData[]>;
@@ -763,13 +757,13 @@ interface BacktestResult {
763
757
  * @example
764
758
  * ```typescript
765
759
  * // Compute RSI indicator
766
- * const data = await client.quant.computeIndicators({
760
+ * const data = await client.quant.indicatorsCompute({
767
761
  * symbols: ['000001'],
768
762
  * formula: 'RSI(14)'
769
763
  * });
770
764
  *
771
765
  * // Screen stocks by formula
772
- * const stocks = await client.quant.screen({
766
+ * const stocks = await client.quant.factorsScreen({
773
767
  * formula: 'RSI(14) < 30'
774
768
  * });
775
769
  * ```
@@ -786,14 +780,14 @@ declare class QuantModule {
786
780
  *
787
781
  * @example
788
782
  * ```typescript
789
- * const indicators = await client.quant.listIndicators();
783
+ * const indicators = await client.quant.indicators();
790
784
  * indicators.forEach(ind => {
791
785
  * console.log(`${ind.name}: ${ind.description}`);
792
786
  * console.log(` Fields: ${ind.fields.join(', ')}`);
793
787
  * });
794
788
  * ```
795
789
  */
796
- listIndicators(): Promise<IndicatorMeta[]>;
790
+ indicators(): Promise<IndicatorMeta[]>;
797
791
  /**
798
792
  * Compute indicator values for given symbols
799
793
  *
@@ -807,25 +801,25 @@ declare class QuantModule {
807
801
  * @example
808
802
  * ```typescript
809
803
  * // RSI indicator
810
- * const data = await client.quant.computeIndicators({
804
+ * const data = await client.quant.indicatorsCompute({
811
805
  * symbols: ['000001'],
812
806
  * formula: 'RSI(14)'
813
807
  * });
814
808
  *
815
809
  * // MACD indicator
816
- * const data = await client.quant.computeIndicators({
810
+ * const data = await client.quant.indicatorsCompute({
817
811
  * symbols: ['000001'],
818
812
  * formula: 'MACD()'
819
813
  * });
820
814
  *
821
815
  * // Standard deviation
822
- * const data = await client.quant.computeIndicators({
816
+ * const data = await client.quant.indicatorsCompute({
823
817
  * symbols: ['000001'],
824
818
  * formula: 'STD(CLOSE, 20)'
825
819
  * });
826
820
  * ```
827
821
  */
828
- computeIndicators(params: IndicatorComputeParams): Promise<IndicatorData[]>;
822
+ indicatorsCompute(params: IndicatorComputeParams): Promise<IndicatorData[]>;
829
823
  /**
830
824
  * Get list of available factors (variables and functions)
831
825
  *
@@ -835,7 +829,7 @@ declare class QuantModule {
835
829
  *
836
830
  * @returns Array of factor definitions organized by level
837
831
  */
838
- listFactors(): Promise<FactorMeta[]>;
832
+ factors(): Promise<FactorMeta[]>;
839
833
  /**
840
834
  * Compute factor values for given symbols
841
835
  *
@@ -851,31 +845,31 @@ declare class QuantModule {
851
845
  * @example
852
846
  * ```typescript
853
847
  * // Simple indicator
854
- * const data = await client.quant.computeFactors({
848
+ * const data = await client.quant.factorsCompute({
855
849
  * symbols: ['000001'],
856
850
  * formula: 'RSI(14)'
857
851
  * });
858
852
  *
859
853
  * // MACD DIF line
860
- * const data = await client.quant.computeFactors({
854
+ * const data = await client.quant.factorsCompute({
861
855
  * symbols: ['000001'],
862
856
  * formula: 'MACD().dif'
863
857
  * });
864
858
  *
865
859
  * // Close above 20-day MA
866
- * const data = await client.quant.computeFactors({
860
+ * const data = await client.quant.factorsCompute({
867
861
  * symbols: ['000001'],
868
862
  * formula: 'CLOSE > MA(CLOSE, 20)'
869
863
  * });
870
864
  *
871
865
  * // Fundamental factors (note: functions require parentheses)
872
- * const data = await client.quant.computeFactors({
866
+ * const data = await client.quant.factorsCompute({
873
867
  * symbols: ['000001'],
874
868
  * formula: 'PE()'
875
869
  * });
876
870
  * ```
877
871
  */
878
- computeFactors(params: FactorComputeParams): Promise<IndicatorData[]>;
872
+ factorsCompute(params: FactorComputeParams): Promise<IndicatorData[]>;
879
873
  /**
880
874
  * Screen stocks based on factor formula
881
875
  *
@@ -889,27 +883,27 @@ declare class QuantModule {
889
883
  * @example
890
884
  * ```typescript
891
885
  * // RSI oversold
892
- * const stocks = await client.quant.screen({
886
+ * const stocks = await client.quant.factorsScreen({
893
887
  * formula: 'RSI(14) < 30'
894
888
  * });
895
889
  *
896
890
  * // Golden cross
897
- * const stocks = await client.quant.screen({
891
+ * const stocks = await client.quant.factorsScreen({
898
892
  * formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
899
893
  * });
900
894
  *
901
895
  * // Uptrend
902
- * const stocks = await client.quant.screen({
896
+ * const stocks = await client.quant.factorsScreen({
903
897
  * formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
904
898
  * });
905
899
  *
906
900
  * // Fundamental screening (note: functions require parentheses)
907
- * const stocks = await client.quant.screen({
901
+ * const stocks = await client.quant.factorsScreen({
908
902
  * formula: '(PE() < 20) & (ROE() > 0.15)'
909
903
  * });
910
904
  * ```
911
905
  */
912
- screen(params: ScreenParams): Promise<ScreenedStock[]>;
906
+ factorsScreen(params: ScreenParams): Promise<ScreenedStock[]>;
913
907
  /**
914
908
  * Get OHLCV daily data for a single symbol
915
909
  *
package/dist/index.js CHANGED
@@ -219,48 +219,33 @@ var StockModule = class {
219
219
  // Price Data
220
220
  // ===========================================================================
221
221
  /**
222
- * Get historical stock prices
222
+ * Get stock quote - current and historical prices with market data
223
223
  *
224
224
  * @param symbol - Stock symbol
225
225
  * @param options - Query options
226
226
  */
227
- async prices(symbol, options = {}) {
227
+ async quote(symbol, options = {}) {
228
228
  const body = { symbol };
229
229
  if (options.startDate) body.start_date = options.startDate;
230
230
  if (options.endDate) body.end_date = options.endDate;
231
231
  const response = await this.client.post(
232
- "/v1/stock/company-prices",
232
+ "/v1/stock/stock-quote",
233
233
  body
234
234
  );
235
235
  return this.normalizeArrayResponse(response);
236
236
  }
237
237
  /**
238
- * Get real-time stock quote
239
- *
240
- * @param symbol - Stock symbol
241
- */
242
- async quote(symbol) {
243
- const response = await this.client.post(
244
- "/v1/stock/quote-realtime",
245
- { symbol }
246
- );
247
- if ("data" in response) {
248
- return response.data;
249
- }
250
- return response;
251
- }
252
- /**
253
- * Get stock index prices
238
+ * Get stock index quote
254
239
  *
255
240
  * @param symbol - Index symbol (e.g., HSI, SPX, DJI)
256
241
  * @param options - Query options
257
242
  */
258
- async indexPrices(symbol, options = {}) {
243
+ async indexQuote(symbol, options = {}) {
259
244
  const body = { symbol };
260
245
  if (options.startDate) body.start_date = options.startDate;
261
246
  if (options.endDate) body.end_date = options.endDate;
262
247
  const response = await this.client.post(
263
- "/v1/stock/index-prices",
248
+ "/v1/stock/index-quote",
264
249
  body
265
250
  );
266
251
  return this.normalizeArrayResponse(response);
@@ -643,14 +628,14 @@ var QuantModule = class {
643
628
  *
644
629
  * @example
645
630
  * ```typescript
646
- * const indicators = await client.quant.listIndicators();
631
+ * const indicators = await client.quant.indicators();
647
632
  * indicators.forEach(ind => {
648
633
  * console.log(`${ind.name}: ${ind.description}`);
649
634
  * console.log(` Fields: ${ind.fields.join(', ')}`);
650
635
  * });
651
636
  * ```
652
637
  */
653
- async listIndicators() {
638
+ async indicators() {
654
639
  return this.client.get("/v1/quant/indicators");
655
640
  }
656
641
  /**
@@ -666,25 +651,25 @@ var QuantModule = class {
666
651
  * @example
667
652
  * ```typescript
668
653
  * // RSI indicator
669
- * const data = await client.quant.computeIndicators({
654
+ * const data = await client.quant.indicatorsCompute({
670
655
  * symbols: ['000001'],
671
656
  * formula: 'RSI(14)'
672
657
  * });
673
658
  *
674
659
  * // MACD indicator
675
- * const data = await client.quant.computeIndicators({
660
+ * const data = await client.quant.indicatorsCompute({
676
661
  * symbols: ['000001'],
677
662
  * formula: 'MACD()'
678
663
  * });
679
664
  *
680
665
  * // Standard deviation
681
- * const data = await client.quant.computeIndicators({
666
+ * const data = await client.quant.indicatorsCompute({
682
667
  * symbols: ['000001'],
683
668
  * formula: 'STD(CLOSE, 20)'
684
669
  * });
685
670
  * ```
686
671
  */
687
- async computeIndicators(params) {
672
+ async indicatorsCompute(params) {
688
673
  const response = await this.client.post("/v1/quant/indicators/compute", {
689
674
  symbols: params.symbols,
690
675
  formula: params.formula,
@@ -706,7 +691,7 @@ var QuantModule = class {
706
691
  *
707
692
  * @returns Array of factor definitions organized by level
708
693
  */
709
- async listFactors() {
694
+ async factors() {
710
695
  return this.client.get("/v1/quant/factors");
711
696
  }
712
697
  /**
@@ -724,31 +709,31 @@ var QuantModule = class {
724
709
  * @example
725
710
  * ```typescript
726
711
  * // Simple indicator
727
- * const data = await client.quant.computeFactors({
712
+ * const data = await client.quant.factorsCompute({
728
713
  * symbols: ['000001'],
729
714
  * formula: 'RSI(14)'
730
715
  * });
731
716
  *
732
717
  * // MACD DIF line
733
- * const data = await client.quant.computeFactors({
718
+ * const data = await client.quant.factorsCompute({
734
719
  * symbols: ['000001'],
735
720
  * formula: 'MACD().dif'
736
721
  * });
737
722
  *
738
723
  * // Close above 20-day MA
739
- * const data = await client.quant.computeFactors({
724
+ * const data = await client.quant.factorsCompute({
740
725
  * symbols: ['000001'],
741
726
  * formula: 'CLOSE > MA(CLOSE, 20)'
742
727
  * });
743
728
  *
744
729
  * // Fundamental factors (note: functions require parentheses)
745
- * const data = await client.quant.computeFactors({
730
+ * const data = await client.quant.factorsCompute({
746
731
  * symbols: ['000001'],
747
732
  * formula: 'PE()'
748
733
  * });
749
734
  * ```
750
735
  */
751
- async computeFactors(params) {
736
+ async factorsCompute(params) {
752
737
  const response = await this.client.post("/v1/quant/factors/compute", {
753
738
  symbols: params.symbols,
754
739
  formula: params.formula,
@@ -771,27 +756,27 @@ var QuantModule = class {
771
756
  * @example
772
757
  * ```typescript
773
758
  * // RSI oversold
774
- * const stocks = await client.quant.screen({
759
+ * const stocks = await client.quant.factorsScreen({
775
760
  * formula: 'RSI(14) < 30'
776
761
  * });
777
762
  *
778
763
  * // Golden cross
779
- * const stocks = await client.quant.screen({
764
+ * const stocks = await client.quant.factorsScreen({
780
765
  * formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
781
766
  * });
782
767
  *
783
768
  * // Uptrend
784
- * const stocks = await client.quant.screen({
769
+ * const stocks = await client.quant.factorsScreen({
785
770
  * formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
786
771
  * });
787
772
  *
788
773
  * // Fundamental screening (note: functions require parentheses)
789
- * const stocks = await client.quant.screen({
774
+ * const stocks = await client.quant.factorsScreen({
790
775
  * formula: '(PE() < 20) & (ROE() > 0.15)'
791
776
  * });
792
777
  * ```
793
778
  */
794
- async screen(params) {
779
+ async factorsScreen(params) {
795
780
  const response = await this.client.post("/v1/quant/factors/screen", {
796
781
  formula: params.formula,
797
782
  market: params.market || "cn",
@@ -1685,7 +1670,7 @@ var Reportify = class {
1685
1670
  headers: {
1686
1671
  Authorization: `Bearer ${this.apiKey}`,
1687
1672
  "Content-Type": "application/json",
1688
- "User-Agent": "reportify-sdk-js/0.3.7"
1673
+ "User-Agent": "reportify-sdk-js/0.3.9"
1689
1674
  },
1690
1675
  body: options.body ? JSON.stringify(options.body) : void 0,
1691
1676
  signal: controller.signal
@@ -1746,7 +1731,7 @@ var Reportify = class {
1746
1731
  headers: {
1747
1732
  Authorization: `Bearer ${this.apiKey}`,
1748
1733
  "Content-Type": "application/json",
1749
- "User-Agent": "reportify-sdk-typescript/0.3.7"
1734
+ "User-Agent": "reportify-sdk-typescript/0.3.9"
1750
1735
  }
1751
1736
  });
1752
1737
  if (!response.ok) {
package/dist/index.mjs CHANGED
@@ -177,48 +177,33 @@ var StockModule = class {
177
177
  // Price Data
178
178
  // ===========================================================================
179
179
  /**
180
- * Get historical stock prices
180
+ * Get stock quote - current and historical prices with market data
181
181
  *
182
182
  * @param symbol - Stock symbol
183
183
  * @param options - Query options
184
184
  */
185
- async prices(symbol, options = {}) {
185
+ async quote(symbol, options = {}) {
186
186
  const body = { symbol };
187
187
  if (options.startDate) body.start_date = options.startDate;
188
188
  if (options.endDate) body.end_date = options.endDate;
189
189
  const response = await this.client.post(
190
- "/v1/stock/company-prices",
190
+ "/v1/stock/stock-quote",
191
191
  body
192
192
  );
193
193
  return this.normalizeArrayResponse(response);
194
194
  }
195
195
  /**
196
- * Get real-time stock quote
197
- *
198
- * @param symbol - Stock symbol
199
- */
200
- async quote(symbol) {
201
- const response = await this.client.post(
202
- "/v1/stock/quote-realtime",
203
- { symbol }
204
- );
205
- if ("data" in response) {
206
- return response.data;
207
- }
208
- return response;
209
- }
210
- /**
211
- * Get stock index prices
196
+ * Get stock index quote
212
197
  *
213
198
  * @param symbol - Index symbol (e.g., HSI, SPX, DJI)
214
199
  * @param options - Query options
215
200
  */
216
- async indexPrices(symbol, options = {}) {
201
+ async indexQuote(symbol, options = {}) {
217
202
  const body = { symbol };
218
203
  if (options.startDate) body.start_date = options.startDate;
219
204
  if (options.endDate) body.end_date = options.endDate;
220
205
  const response = await this.client.post(
221
- "/v1/stock/index-prices",
206
+ "/v1/stock/index-quote",
222
207
  body
223
208
  );
224
209
  return this.normalizeArrayResponse(response);
@@ -601,14 +586,14 @@ var QuantModule = class {
601
586
  *
602
587
  * @example
603
588
  * ```typescript
604
- * const indicators = await client.quant.listIndicators();
589
+ * const indicators = await client.quant.indicators();
605
590
  * indicators.forEach(ind => {
606
591
  * console.log(`${ind.name}: ${ind.description}`);
607
592
  * console.log(` Fields: ${ind.fields.join(', ')}`);
608
593
  * });
609
594
  * ```
610
595
  */
611
- async listIndicators() {
596
+ async indicators() {
612
597
  return this.client.get("/v1/quant/indicators");
613
598
  }
614
599
  /**
@@ -624,25 +609,25 @@ var QuantModule = class {
624
609
  * @example
625
610
  * ```typescript
626
611
  * // RSI indicator
627
- * const data = await client.quant.computeIndicators({
612
+ * const data = await client.quant.indicatorsCompute({
628
613
  * symbols: ['000001'],
629
614
  * formula: 'RSI(14)'
630
615
  * });
631
616
  *
632
617
  * // MACD indicator
633
- * const data = await client.quant.computeIndicators({
618
+ * const data = await client.quant.indicatorsCompute({
634
619
  * symbols: ['000001'],
635
620
  * formula: 'MACD()'
636
621
  * });
637
622
  *
638
623
  * // Standard deviation
639
- * const data = await client.quant.computeIndicators({
624
+ * const data = await client.quant.indicatorsCompute({
640
625
  * symbols: ['000001'],
641
626
  * formula: 'STD(CLOSE, 20)'
642
627
  * });
643
628
  * ```
644
629
  */
645
- async computeIndicators(params) {
630
+ async indicatorsCompute(params) {
646
631
  const response = await this.client.post("/v1/quant/indicators/compute", {
647
632
  symbols: params.symbols,
648
633
  formula: params.formula,
@@ -664,7 +649,7 @@ var QuantModule = class {
664
649
  *
665
650
  * @returns Array of factor definitions organized by level
666
651
  */
667
- async listFactors() {
652
+ async factors() {
668
653
  return this.client.get("/v1/quant/factors");
669
654
  }
670
655
  /**
@@ -682,31 +667,31 @@ var QuantModule = class {
682
667
  * @example
683
668
  * ```typescript
684
669
  * // Simple indicator
685
- * const data = await client.quant.computeFactors({
670
+ * const data = await client.quant.factorsCompute({
686
671
  * symbols: ['000001'],
687
672
  * formula: 'RSI(14)'
688
673
  * });
689
674
  *
690
675
  * // MACD DIF line
691
- * const data = await client.quant.computeFactors({
676
+ * const data = await client.quant.factorsCompute({
692
677
  * symbols: ['000001'],
693
678
  * formula: 'MACD().dif'
694
679
  * });
695
680
  *
696
681
  * // Close above 20-day MA
697
- * const data = await client.quant.computeFactors({
682
+ * const data = await client.quant.factorsCompute({
698
683
  * symbols: ['000001'],
699
684
  * formula: 'CLOSE > MA(CLOSE, 20)'
700
685
  * });
701
686
  *
702
687
  * // Fundamental factors (note: functions require parentheses)
703
- * const data = await client.quant.computeFactors({
688
+ * const data = await client.quant.factorsCompute({
704
689
  * symbols: ['000001'],
705
690
  * formula: 'PE()'
706
691
  * });
707
692
  * ```
708
693
  */
709
- async computeFactors(params) {
694
+ async factorsCompute(params) {
710
695
  const response = await this.client.post("/v1/quant/factors/compute", {
711
696
  symbols: params.symbols,
712
697
  formula: params.formula,
@@ -729,27 +714,27 @@ var QuantModule = class {
729
714
  * @example
730
715
  * ```typescript
731
716
  * // RSI oversold
732
- * const stocks = await client.quant.screen({
717
+ * const stocks = await client.quant.factorsScreen({
733
718
  * formula: 'RSI(14) < 30'
734
719
  * });
735
720
  *
736
721
  * // Golden cross
737
- * const stocks = await client.quant.screen({
722
+ * const stocks = await client.quant.factorsScreen({
738
723
  * formula: 'CROSS(MA(CLOSE, 5), MA(CLOSE, 10))'
739
724
  * });
740
725
  *
741
726
  * // Uptrend
742
- * const stocks = await client.quant.screen({
727
+ * const stocks = await client.quant.factorsScreen({
743
728
  * formula: '(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))'
744
729
  * });
745
730
  *
746
731
  * // Fundamental screening (note: functions require parentheses)
747
- * const stocks = await client.quant.screen({
732
+ * const stocks = await client.quant.factorsScreen({
748
733
  * formula: '(PE() < 20) & (ROE() > 0.15)'
749
734
  * });
750
735
  * ```
751
736
  */
752
- async screen(params) {
737
+ async factorsScreen(params) {
753
738
  const response = await this.client.post("/v1/quant/factors/screen", {
754
739
  formula: params.formula,
755
740
  market: params.market || "cn",
@@ -1643,7 +1628,7 @@ var Reportify = class {
1643
1628
  headers: {
1644
1629
  Authorization: `Bearer ${this.apiKey}`,
1645
1630
  "Content-Type": "application/json",
1646
- "User-Agent": "reportify-sdk-js/0.3.7"
1631
+ "User-Agent": "reportify-sdk-js/0.3.9"
1647
1632
  },
1648
1633
  body: options.body ? JSON.stringify(options.body) : void 0,
1649
1634
  signal: controller.signal
@@ -1704,7 +1689,7 @@ var Reportify = class {
1704
1689
  headers: {
1705
1690
  Authorization: `Bearer ${this.apiKey}`,
1706
1691
  "Content-Type": "application/json",
1707
- "User-Agent": "reportify-sdk-typescript/0.3.7"
1692
+ "User-Agent": "reportify-sdk-typescript/0.3.9"
1708
1693
  }
1709
1694
  });
1710
1695
  if (!response.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reportify-sdk",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "TypeScript SDK for Reportify API - Financial data and document search",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",