reportify-sdk 0.3.19 → 0.3.20
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.d.mts +132 -120
- package/dist/index.d.ts +132 -120
- package/dist/index.js +191 -180
- package/dist/index.mjs +190 -180
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1525,186 +1525,6 @@ var UserModule = class {
|
|
|
1525
1525
|
{ symbol }
|
|
1526
1526
|
);
|
|
1527
1527
|
}
|
|
1528
|
-
/**
|
|
1529
|
-
* Create a new follow group
|
|
1530
|
-
*
|
|
1531
|
-
* @param name - Group name
|
|
1532
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1533
|
-
* follow_type: 1=company, 3=channel
|
|
1534
|
-
* @returns Created group information including group_id, name, and count
|
|
1535
|
-
*
|
|
1536
|
-
* @example
|
|
1537
|
-
* ```typescript
|
|
1538
|
-
* const result = await client.user.createFollowGroup('My Stocks', [
|
|
1539
|
-
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1540
|
-
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1541
|
-
* ]);
|
|
1542
|
-
* console.log(`Created group: ${result.group_id}`);
|
|
1543
|
-
* ```
|
|
1544
|
-
*/
|
|
1545
|
-
async createFollowGroup(name, followValues) {
|
|
1546
|
-
const json = { name };
|
|
1547
|
-
if (followValues !== void 0) {
|
|
1548
|
-
json.follow_values = followValues;
|
|
1549
|
-
}
|
|
1550
|
-
return this.client.post(
|
|
1551
|
-
"/v1/tools/user/follow-groups",
|
|
1552
|
-
json
|
|
1553
|
-
);
|
|
1554
|
-
}
|
|
1555
|
-
/**
|
|
1556
|
-
* Get all follow groups for authenticated user
|
|
1557
|
-
*
|
|
1558
|
-
* @returns List of follow groups with group_id, name, and count
|
|
1559
|
-
*
|
|
1560
|
-
* @example
|
|
1561
|
-
* ```typescript
|
|
1562
|
-
* const groups = await client.user.getFollowGroups();
|
|
1563
|
-
* groups.forEach(group => {
|
|
1564
|
-
* console.log(`${group.name}: ${group.count} items`);
|
|
1565
|
-
* });
|
|
1566
|
-
* ```
|
|
1567
|
-
*/
|
|
1568
|
-
async getFollowGroups() {
|
|
1569
|
-
const response = await this.client.get("/v1/tools/user/follow-groups");
|
|
1570
|
-
return response.groups || [];
|
|
1571
|
-
}
|
|
1572
|
-
/**
|
|
1573
|
-
* Get a follow group by ID
|
|
1574
|
-
*
|
|
1575
|
-
* @param groupId - Group ID
|
|
1576
|
-
* @returns Group information including group_id, name, and count
|
|
1577
|
-
*
|
|
1578
|
-
* @example
|
|
1579
|
-
* ```typescript
|
|
1580
|
-
* const group = await client.user.getFollowGroup('group_123');
|
|
1581
|
-
* console.log(`${group.name}: ${group.count} items`);
|
|
1582
|
-
* ```
|
|
1583
|
-
*/
|
|
1584
|
-
async getFollowGroup(groupId) {
|
|
1585
|
-
return this.client.get(
|
|
1586
|
-
`/v1/tools/user/follow-groups/${groupId}`
|
|
1587
|
-
);
|
|
1588
|
-
}
|
|
1589
|
-
/**
|
|
1590
|
-
* Update a follow group
|
|
1591
|
-
*
|
|
1592
|
-
* @param groupId - Group ID
|
|
1593
|
-
* @param name - New group name
|
|
1594
|
-
* @returns Updated group information
|
|
1595
|
-
*
|
|
1596
|
-
* @example
|
|
1597
|
-
* ```typescript
|
|
1598
|
-
* const result = await client.user.updateFollowGroup('group_123', 'New Name');
|
|
1599
|
-
* console.log(`Updated: ${result.name}`);
|
|
1600
|
-
* ```
|
|
1601
|
-
*/
|
|
1602
|
-
async updateFollowGroup(groupId, name) {
|
|
1603
|
-
const json = {};
|
|
1604
|
-
if (name !== void 0) {
|
|
1605
|
-
json.name = name;
|
|
1606
|
-
}
|
|
1607
|
-
return this.client.post(
|
|
1608
|
-
`/v1/tools/user/follow-groups/${groupId}`,
|
|
1609
|
-
json
|
|
1610
|
-
);
|
|
1611
|
-
}
|
|
1612
|
-
/**
|
|
1613
|
-
* Delete a follow group
|
|
1614
|
-
*
|
|
1615
|
-
* @param groupId - Group ID
|
|
1616
|
-
* @returns Status message
|
|
1617
|
-
*
|
|
1618
|
-
* @example
|
|
1619
|
-
* ```typescript
|
|
1620
|
-
* await client.user.deleteFollowGroup('group_123');
|
|
1621
|
-
* ```
|
|
1622
|
-
*/
|
|
1623
|
-
async deleteFollowGroup(groupId) {
|
|
1624
|
-
return this.client.delete(`/v1/tools/user/follow-groups/${groupId}`);
|
|
1625
|
-
}
|
|
1626
|
-
/**
|
|
1627
|
-
* Add follows to a group
|
|
1628
|
-
*
|
|
1629
|
-
* @param groupId - Group ID
|
|
1630
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1631
|
-
* follow_type: 1=company, 3=channel
|
|
1632
|
-
* @returns Status message
|
|
1633
|
-
*
|
|
1634
|
-
* @example
|
|
1635
|
-
* ```typescript
|
|
1636
|
-
* await client.user.addFollowsToGroup('group_123', [
|
|
1637
|
-
* { follow_type: 1, follow_value: 'US:TSLA' }
|
|
1638
|
-
* ]);
|
|
1639
|
-
* ```
|
|
1640
|
-
*/
|
|
1641
|
-
async addFollowsToGroup(groupId, followValues) {
|
|
1642
|
-
return this.client.post(`/v1/tools/user/follow-groups/${groupId}/follows`, {
|
|
1643
|
-
follow_values: followValues
|
|
1644
|
-
});
|
|
1645
|
-
}
|
|
1646
|
-
/**
|
|
1647
|
-
* Remove follows from a group
|
|
1648
|
-
*
|
|
1649
|
-
* @param groupId - Group ID
|
|
1650
|
-
* @param followValues - List of follow values to remove (e.g., stock symbols, channel IDs)
|
|
1651
|
-
* @returns Status message
|
|
1652
|
-
*
|
|
1653
|
-
* @example
|
|
1654
|
-
* ```typescript
|
|
1655
|
-
* await client.user.removeFollowsFromGroup('group_123', ['AAPL', 'MSFT']);
|
|
1656
|
-
* ```
|
|
1657
|
-
*/
|
|
1658
|
-
async removeFollowsFromGroup(groupId, followValues) {
|
|
1659
|
-
return this.client.delete(
|
|
1660
|
-
`/v1/tools/user/follow-groups/${groupId}/follows`,
|
|
1661
|
-
{ follow_values: followValues }
|
|
1662
|
-
);
|
|
1663
|
-
}
|
|
1664
|
-
/**
|
|
1665
|
-
* Set follows for a group (replace all existing follows)
|
|
1666
|
-
*
|
|
1667
|
-
* @param groupId - Group ID
|
|
1668
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1669
|
-
* follow_type: 1=company, 3=channel
|
|
1670
|
-
* @returns Status message
|
|
1671
|
-
*
|
|
1672
|
-
* @example
|
|
1673
|
-
* ```typescript
|
|
1674
|
-
* await client.user.setGroupFollows('group_123', [
|
|
1675
|
-
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1676
|
-
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1677
|
-
* ]);
|
|
1678
|
-
* ```
|
|
1679
|
-
*/
|
|
1680
|
-
async setGroupFollows(groupId, followValues) {
|
|
1681
|
-
return this.client.put(`/v1/tools/user/follow-groups/${groupId}/follows`, {
|
|
1682
|
-
follow_values: followValues
|
|
1683
|
-
});
|
|
1684
|
-
}
|
|
1685
|
-
/**
|
|
1686
|
-
* Get reports for a follow group
|
|
1687
|
-
*
|
|
1688
|
-
* @param groupId - Group ID
|
|
1689
|
-
* @param pageNum - Page number (default: 1)
|
|
1690
|
-
* @param pageSize - Page size (default: 10, max: 100)
|
|
1691
|
-
* @returns Report data including items list, total_count, page_num, and page_size
|
|
1692
|
-
*
|
|
1693
|
-
* @example
|
|
1694
|
-
* ```typescript
|
|
1695
|
-
* const result = await client.user.getGroupReports('group_123', 1, 20);
|
|
1696
|
-
* console.log(`Total: ${result.total_count}`);
|
|
1697
|
-
* result.items.forEach(report => {
|
|
1698
|
-
* console.log(report.title || 'Untitled');
|
|
1699
|
-
* });
|
|
1700
|
-
* ```
|
|
1701
|
-
*/
|
|
1702
|
-
async getGroupReports(groupId, pageNum = 1, pageSize = 10) {
|
|
1703
|
-
return this.client.get(`/v1/tools/user/follow-groups/${groupId}/reports`, {
|
|
1704
|
-
page_num: pageNum,
|
|
1705
|
-
page_size: pageSize
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
1528
|
};
|
|
1709
1529
|
|
|
1710
1530
|
// src/search.ts
|
|
@@ -1888,6 +1708,193 @@ var SearchModule = class {
|
|
|
1888
1708
|
}
|
|
1889
1709
|
};
|
|
1890
1710
|
|
|
1711
|
+
// src/following.ts
|
|
1712
|
+
var FollowingModule = class {
|
|
1713
|
+
constructor(client) {
|
|
1714
|
+
this.client = client;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Create a new follow group
|
|
1718
|
+
*
|
|
1719
|
+
* @param name - Group name
|
|
1720
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1721
|
+
* follow_type: 1=company, 3=channel
|
|
1722
|
+
* @returns Created group information including group_id, name, and count
|
|
1723
|
+
*
|
|
1724
|
+
* @example
|
|
1725
|
+
* ```typescript
|
|
1726
|
+
* const result = await client.following.createFollowGroup('My Stocks', [
|
|
1727
|
+
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1728
|
+
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1729
|
+
* ]);
|
|
1730
|
+
* console.log(`Created group: ${result.group_id}`);
|
|
1731
|
+
* ```
|
|
1732
|
+
*/
|
|
1733
|
+
async createFollowGroup(name, followValues) {
|
|
1734
|
+
const json = { name };
|
|
1735
|
+
if (followValues !== void 0) {
|
|
1736
|
+
json.follow_values = followValues;
|
|
1737
|
+
}
|
|
1738
|
+
return this.client.post(
|
|
1739
|
+
"/v1/following/groups",
|
|
1740
|
+
json
|
|
1741
|
+
);
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Get all follow groups for authenticated user
|
|
1745
|
+
*
|
|
1746
|
+
* @returns List of follow groups with group_id, name, and count
|
|
1747
|
+
*
|
|
1748
|
+
* @example
|
|
1749
|
+
* ```typescript
|
|
1750
|
+
* const groups = await client.following.getFollowGroups();
|
|
1751
|
+
* groups.forEach(group => {
|
|
1752
|
+
* console.log(`${group.name}: ${group.count} items`);
|
|
1753
|
+
* });
|
|
1754
|
+
* ```
|
|
1755
|
+
*/
|
|
1756
|
+
async getFollowGroups() {
|
|
1757
|
+
const response = await this.client.get("/v1/following/groups");
|
|
1758
|
+
return response.groups || [];
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* Get a follow group by ID
|
|
1762
|
+
*
|
|
1763
|
+
* @param groupId - Group ID
|
|
1764
|
+
* @returns Group information including group_id, name, and count
|
|
1765
|
+
*
|
|
1766
|
+
* @example
|
|
1767
|
+
* ```typescript
|
|
1768
|
+
* const group = await client.following.getFollowGroup('group_123');
|
|
1769
|
+
* console.log(`${group.name}: ${group.count} items`);
|
|
1770
|
+
* ```
|
|
1771
|
+
*/
|
|
1772
|
+
async getFollowGroup(groupId) {
|
|
1773
|
+
return this.client.get(
|
|
1774
|
+
`/v1/following/groups/${groupId}`
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* Update a follow group
|
|
1779
|
+
*
|
|
1780
|
+
* @param groupId - Group ID
|
|
1781
|
+
* @param name - New group name
|
|
1782
|
+
* @returns Updated group information
|
|
1783
|
+
*
|
|
1784
|
+
* @example
|
|
1785
|
+
* ```typescript
|
|
1786
|
+
* const result = await client.following.updateFollowGroup('group_123', 'New Name');
|
|
1787
|
+
* console.log(`Updated: ${result.name}`);
|
|
1788
|
+
* ```
|
|
1789
|
+
*/
|
|
1790
|
+
async updateFollowGroup(groupId, name) {
|
|
1791
|
+
const json = {};
|
|
1792
|
+
if (name !== void 0) {
|
|
1793
|
+
json.name = name;
|
|
1794
|
+
}
|
|
1795
|
+
return this.client.post(
|
|
1796
|
+
`/v1/following/groups/${groupId}`,
|
|
1797
|
+
json
|
|
1798
|
+
);
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* Delete a follow group
|
|
1802
|
+
*
|
|
1803
|
+
* @param groupId - Group ID
|
|
1804
|
+
* @returns Status message
|
|
1805
|
+
*
|
|
1806
|
+
* @example
|
|
1807
|
+
* ```typescript
|
|
1808
|
+
* await client.following.deleteFollowGroup('group_123');
|
|
1809
|
+
* ```
|
|
1810
|
+
*/
|
|
1811
|
+
async deleteFollowGroup(groupId) {
|
|
1812
|
+
return this.client.delete(`/v1/following/groups/${groupId}`);
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* Add follows to a group
|
|
1816
|
+
*
|
|
1817
|
+
* @param groupId - Group ID
|
|
1818
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1819
|
+
* follow_type: 1=company, 3=channel
|
|
1820
|
+
* @returns Status message
|
|
1821
|
+
*
|
|
1822
|
+
* @example
|
|
1823
|
+
* ```typescript
|
|
1824
|
+
* await client.following.addFollowsToGroup('group_123', [
|
|
1825
|
+
* { follow_type: 1, follow_value: 'US:TSLA' }
|
|
1826
|
+
* ]);
|
|
1827
|
+
* ```
|
|
1828
|
+
*/
|
|
1829
|
+
async addFollowsToGroup(groupId, followValues) {
|
|
1830
|
+
return this.client.post(`/v1/following/groups/${groupId}/follows`, {
|
|
1831
|
+
follow_values: followValues
|
|
1832
|
+
});
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Remove follows from a group
|
|
1836
|
+
*
|
|
1837
|
+
* @param groupId - Group ID
|
|
1838
|
+
* @param followValues - List of follow values to remove (e.g., stock symbols, channel IDs)
|
|
1839
|
+
* @returns Status message
|
|
1840
|
+
*
|
|
1841
|
+
* @example
|
|
1842
|
+
* ```typescript
|
|
1843
|
+
* await client.following.removeFollowsFromGroup('group_123', ['AAPL', 'MSFT']);
|
|
1844
|
+
* ```
|
|
1845
|
+
*/
|
|
1846
|
+
async removeFollowsFromGroup(groupId, followValues) {
|
|
1847
|
+
return this.client.delete(
|
|
1848
|
+
`/v1/following/groups/${groupId}/follows`,
|
|
1849
|
+
{ follow_values: followValues }
|
|
1850
|
+
);
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Set follows for a group (replace all existing follows)
|
|
1854
|
+
*
|
|
1855
|
+
* @param groupId - Group ID
|
|
1856
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1857
|
+
* follow_type: 1=company, 3=channel
|
|
1858
|
+
* @returns Status message
|
|
1859
|
+
*
|
|
1860
|
+
* @example
|
|
1861
|
+
* ```typescript
|
|
1862
|
+
* await client.following.setGroupFollows('group_123', [
|
|
1863
|
+
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1864
|
+
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1865
|
+
* ]);
|
|
1866
|
+
* ```
|
|
1867
|
+
*/
|
|
1868
|
+
async setGroupFollows(groupId, followValues) {
|
|
1869
|
+
return this.client.put(`/v1/following/groups/${groupId}/follows`, {
|
|
1870
|
+
follow_values: followValues
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* Get docs for a follow group
|
|
1875
|
+
*
|
|
1876
|
+
* @param groupId - Group ID
|
|
1877
|
+
* @param pageNum - Page number (default: 1)
|
|
1878
|
+
* @param pageSize - Page size (default: 10, max: 100)
|
|
1879
|
+
* @returns docs data including items list, total_count, page_num, and page_size
|
|
1880
|
+
*
|
|
1881
|
+
* @example
|
|
1882
|
+
* ```typescript
|
|
1883
|
+
* const result = await client.following.getFollowGroupDocs('group_123', 1, 20);
|
|
1884
|
+
* console.log(`Total: ${result.total_count}`);
|
|
1885
|
+
* result.items.forEach(doc => {
|
|
1886
|
+
* console.log(doc.title || 'Untitled');
|
|
1887
|
+
* });
|
|
1888
|
+
* ```
|
|
1889
|
+
*/
|
|
1890
|
+
async getFollowGroupDocs(groupId, pageNum = 1, pageSize = 10) {
|
|
1891
|
+
return this.client.get(`/v1/following/groups/${groupId}/docs`, {
|
|
1892
|
+
page_num: pageNum,
|
|
1893
|
+
page_size: pageSize
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
|
|
1891
1898
|
// src/types.ts
|
|
1892
1899
|
var ReportifyError = class extends Error {
|
|
1893
1900
|
statusCode;
|
|
@@ -1941,6 +1948,7 @@ var Reportify = class {
|
|
|
1941
1948
|
kb;
|
|
1942
1949
|
timeline;
|
|
1943
1950
|
user;
|
|
1951
|
+
following;
|
|
1944
1952
|
constructor(config) {
|
|
1945
1953
|
if (!config.apiKey) {
|
|
1946
1954
|
throw new AuthenticationError("API key is required");
|
|
@@ -1959,6 +1967,7 @@ var Reportify = class {
|
|
|
1959
1967
|
this.kb = new KBModule(this);
|
|
1960
1968
|
this.timeline = new TimelineModule(this);
|
|
1961
1969
|
this.user = new UserModule(this);
|
|
1970
|
+
this.following = new FollowingModule(this);
|
|
1962
1971
|
}
|
|
1963
1972
|
/**
|
|
1964
1973
|
* Make an HTTP request to the API
|
|
@@ -2072,6 +2081,7 @@ export {
|
|
|
2072
2081
|
ChatModule,
|
|
2073
2082
|
ConceptsModule,
|
|
2074
2083
|
DocsModule,
|
|
2084
|
+
FollowingModule,
|
|
2075
2085
|
KBModule,
|
|
2076
2086
|
NotFoundError,
|
|
2077
2087
|
QuantModule,
|