reportify-sdk 0.3.19 → 0.3.21
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 +134 -120
- package/dist/index.d.ts +134 -120
- package/dist/index.js +193 -180
- package/dist/index.mjs +192 -180
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
ChatModule: () => ChatModule,
|
|
28
28
|
ConceptsModule: () => ConceptsModule,
|
|
29
29
|
DocsModule: () => DocsModule,
|
|
30
|
+
FollowingModule: () => FollowingModule,
|
|
30
31
|
KBModule: () => KBModule,
|
|
31
32
|
NotFoundError: () => NotFoundError,
|
|
32
33
|
QuantModule: () => QuantModule,
|
|
@@ -1213,11 +1214,13 @@ var AgentModule = class {
|
|
|
1213
1214
|
* @param options - Optional parameters
|
|
1214
1215
|
* @param options.title - Conversation title
|
|
1215
1216
|
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1217
|
+
* @param options.meta - Metadata dict (optional)
|
|
1216
1218
|
*/
|
|
1217
1219
|
async createConversation(agentId, options = {}) {
|
|
1218
1220
|
const body = { agent_id: agentId };
|
|
1219
1221
|
if (options.title) body.title = options.title;
|
|
1220
1222
|
if (options.conversationType) body.conversation_type = options.conversationType;
|
|
1223
|
+
if (options.meta) body.meta = options.meta;
|
|
1221
1224
|
const response = await this.client.post("/v1/agent/conversations", body);
|
|
1222
1225
|
return {
|
|
1223
1226
|
id: response.id,
|
|
@@ -1567,186 +1570,6 @@ var UserModule = class {
|
|
|
1567
1570
|
{ symbol }
|
|
1568
1571
|
);
|
|
1569
1572
|
}
|
|
1570
|
-
/**
|
|
1571
|
-
* Create a new follow group
|
|
1572
|
-
*
|
|
1573
|
-
* @param name - Group name
|
|
1574
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1575
|
-
* follow_type: 1=company, 3=channel
|
|
1576
|
-
* @returns Created group information including group_id, name, and count
|
|
1577
|
-
*
|
|
1578
|
-
* @example
|
|
1579
|
-
* ```typescript
|
|
1580
|
-
* const result = await client.user.createFollowGroup('My Stocks', [
|
|
1581
|
-
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1582
|
-
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1583
|
-
* ]);
|
|
1584
|
-
* console.log(`Created group: ${result.group_id}`);
|
|
1585
|
-
* ```
|
|
1586
|
-
*/
|
|
1587
|
-
async createFollowGroup(name, followValues) {
|
|
1588
|
-
const json = { name };
|
|
1589
|
-
if (followValues !== void 0) {
|
|
1590
|
-
json.follow_values = followValues;
|
|
1591
|
-
}
|
|
1592
|
-
return this.client.post(
|
|
1593
|
-
"/v1/tools/user/follow-groups",
|
|
1594
|
-
json
|
|
1595
|
-
);
|
|
1596
|
-
}
|
|
1597
|
-
/**
|
|
1598
|
-
* Get all follow groups for authenticated user
|
|
1599
|
-
*
|
|
1600
|
-
* @returns List of follow groups with group_id, name, and count
|
|
1601
|
-
*
|
|
1602
|
-
* @example
|
|
1603
|
-
* ```typescript
|
|
1604
|
-
* const groups = await client.user.getFollowGroups();
|
|
1605
|
-
* groups.forEach(group => {
|
|
1606
|
-
* console.log(`${group.name}: ${group.count} items`);
|
|
1607
|
-
* });
|
|
1608
|
-
* ```
|
|
1609
|
-
*/
|
|
1610
|
-
async getFollowGroups() {
|
|
1611
|
-
const response = await this.client.get("/v1/tools/user/follow-groups");
|
|
1612
|
-
return response.groups || [];
|
|
1613
|
-
}
|
|
1614
|
-
/**
|
|
1615
|
-
* Get a follow group by ID
|
|
1616
|
-
*
|
|
1617
|
-
* @param groupId - Group ID
|
|
1618
|
-
* @returns Group information including group_id, name, and count
|
|
1619
|
-
*
|
|
1620
|
-
* @example
|
|
1621
|
-
* ```typescript
|
|
1622
|
-
* const group = await client.user.getFollowGroup('group_123');
|
|
1623
|
-
* console.log(`${group.name}: ${group.count} items`);
|
|
1624
|
-
* ```
|
|
1625
|
-
*/
|
|
1626
|
-
async getFollowGroup(groupId) {
|
|
1627
|
-
return this.client.get(
|
|
1628
|
-
`/v1/tools/user/follow-groups/${groupId}`
|
|
1629
|
-
);
|
|
1630
|
-
}
|
|
1631
|
-
/**
|
|
1632
|
-
* Update a follow group
|
|
1633
|
-
*
|
|
1634
|
-
* @param groupId - Group ID
|
|
1635
|
-
* @param name - New group name
|
|
1636
|
-
* @returns Updated group information
|
|
1637
|
-
*
|
|
1638
|
-
* @example
|
|
1639
|
-
* ```typescript
|
|
1640
|
-
* const result = await client.user.updateFollowGroup('group_123', 'New Name');
|
|
1641
|
-
* console.log(`Updated: ${result.name}`);
|
|
1642
|
-
* ```
|
|
1643
|
-
*/
|
|
1644
|
-
async updateFollowGroup(groupId, name) {
|
|
1645
|
-
const json = {};
|
|
1646
|
-
if (name !== void 0) {
|
|
1647
|
-
json.name = name;
|
|
1648
|
-
}
|
|
1649
|
-
return this.client.post(
|
|
1650
|
-
`/v1/tools/user/follow-groups/${groupId}`,
|
|
1651
|
-
json
|
|
1652
|
-
);
|
|
1653
|
-
}
|
|
1654
|
-
/**
|
|
1655
|
-
* Delete a follow group
|
|
1656
|
-
*
|
|
1657
|
-
* @param groupId - Group ID
|
|
1658
|
-
* @returns Status message
|
|
1659
|
-
*
|
|
1660
|
-
* @example
|
|
1661
|
-
* ```typescript
|
|
1662
|
-
* await client.user.deleteFollowGroup('group_123');
|
|
1663
|
-
* ```
|
|
1664
|
-
*/
|
|
1665
|
-
async deleteFollowGroup(groupId) {
|
|
1666
|
-
return this.client.delete(`/v1/tools/user/follow-groups/${groupId}`);
|
|
1667
|
-
}
|
|
1668
|
-
/**
|
|
1669
|
-
* Add follows to a group
|
|
1670
|
-
*
|
|
1671
|
-
* @param groupId - Group ID
|
|
1672
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1673
|
-
* follow_type: 1=company, 3=channel
|
|
1674
|
-
* @returns Status message
|
|
1675
|
-
*
|
|
1676
|
-
* @example
|
|
1677
|
-
* ```typescript
|
|
1678
|
-
* await client.user.addFollowsToGroup('group_123', [
|
|
1679
|
-
* { follow_type: 1, follow_value: 'US:TSLA' }
|
|
1680
|
-
* ]);
|
|
1681
|
-
* ```
|
|
1682
|
-
*/
|
|
1683
|
-
async addFollowsToGroup(groupId, followValues) {
|
|
1684
|
-
return this.client.post(`/v1/tools/user/follow-groups/${groupId}/follows`, {
|
|
1685
|
-
follow_values: followValues
|
|
1686
|
-
});
|
|
1687
|
-
}
|
|
1688
|
-
/**
|
|
1689
|
-
* Remove follows from a group
|
|
1690
|
-
*
|
|
1691
|
-
* @param groupId - Group ID
|
|
1692
|
-
* @param followValues - List of follow values to remove (e.g., stock symbols, channel IDs)
|
|
1693
|
-
* @returns Status message
|
|
1694
|
-
*
|
|
1695
|
-
* @example
|
|
1696
|
-
* ```typescript
|
|
1697
|
-
* await client.user.removeFollowsFromGroup('group_123', ['AAPL', 'MSFT']);
|
|
1698
|
-
* ```
|
|
1699
|
-
*/
|
|
1700
|
-
async removeFollowsFromGroup(groupId, followValues) {
|
|
1701
|
-
return this.client.delete(
|
|
1702
|
-
`/v1/tools/user/follow-groups/${groupId}/follows`,
|
|
1703
|
-
{ follow_values: followValues }
|
|
1704
|
-
);
|
|
1705
|
-
}
|
|
1706
|
-
/**
|
|
1707
|
-
* Set follows for a group (replace all existing follows)
|
|
1708
|
-
*
|
|
1709
|
-
* @param groupId - Group ID
|
|
1710
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1711
|
-
* follow_type: 1=company, 3=channel
|
|
1712
|
-
* @returns Status message
|
|
1713
|
-
*
|
|
1714
|
-
* @example
|
|
1715
|
-
* ```typescript
|
|
1716
|
-
* await client.user.setGroupFollows('group_123', [
|
|
1717
|
-
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1718
|
-
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1719
|
-
* ]);
|
|
1720
|
-
* ```
|
|
1721
|
-
*/
|
|
1722
|
-
async setGroupFollows(groupId, followValues) {
|
|
1723
|
-
return this.client.put(`/v1/tools/user/follow-groups/${groupId}/follows`, {
|
|
1724
|
-
follow_values: followValues
|
|
1725
|
-
});
|
|
1726
|
-
}
|
|
1727
|
-
/**
|
|
1728
|
-
* Get reports for a follow group
|
|
1729
|
-
*
|
|
1730
|
-
* @param groupId - Group ID
|
|
1731
|
-
* @param pageNum - Page number (default: 1)
|
|
1732
|
-
* @param pageSize - Page size (default: 10, max: 100)
|
|
1733
|
-
* @returns Report data including items list, total_count, page_num, and page_size
|
|
1734
|
-
*
|
|
1735
|
-
* @example
|
|
1736
|
-
* ```typescript
|
|
1737
|
-
* const result = await client.user.getGroupReports('group_123', 1, 20);
|
|
1738
|
-
* console.log(`Total: ${result.total_count}`);
|
|
1739
|
-
* result.items.forEach(report => {
|
|
1740
|
-
* console.log(report.title || 'Untitled');
|
|
1741
|
-
* });
|
|
1742
|
-
* ```
|
|
1743
|
-
*/
|
|
1744
|
-
async getGroupReports(groupId, pageNum = 1, pageSize = 10) {
|
|
1745
|
-
return this.client.get(`/v1/tools/user/follow-groups/${groupId}/reports`, {
|
|
1746
|
-
page_num: pageNum,
|
|
1747
|
-
page_size: pageSize
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
1573
|
};
|
|
1751
1574
|
|
|
1752
1575
|
// src/search.ts
|
|
@@ -1930,6 +1753,193 @@ var SearchModule = class {
|
|
|
1930
1753
|
}
|
|
1931
1754
|
};
|
|
1932
1755
|
|
|
1756
|
+
// src/following.ts
|
|
1757
|
+
var FollowingModule = class {
|
|
1758
|
+
constructor(client) {
|
|
1759
|
+
this.client = client;
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Create a new follow group
|
|
1763
|
+
*
|
|
1764
|
+
* @param name - Group name
|
|
1765
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1766
|
+
* follow_type: 1=company, 3=channel
|
|
1767
|
+
* @returns Created group information including group_id, name, and count
|
|
1768
|
+
*
|
|
1769
|
+
* @example
|
|
1770
|
+
* ```typescript
|
|
1771
|
+
* const result = await client.following.createFollowGroup('My Stocks', [
|
|
1772
|
+
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1773
|
+
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1774
|
+
* ]);
|
|
1775
|
+
* console.log(`Created group: ${result.group_id}`);
|
|
1776
|
+
* ```
|
|
1777
|
+
*/
|
|
1778
|
+
async createFollowGroup(name, followValues) {
|
|
1779
|
+
const json = { name };
|
|
1780
|
+
if (followValues !== void 0) {
|
|
1781
|
+
json.follow_values = followValues;
|
|
1782
|
+
}
|
|
1783
|
+
return this.client.post(
|
|
1784
|
+
"/v1/following/groups",
|
|
1785
|
+
json
|
|
1786
|
+
);
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* Get all follow groups for authenticated user
|
|
1790
|
+
*
|
|
1791
|
+
* @returns List of follow groups with group_id, name, and count
|
|
1792
|
+
*
|
|
1793
|
+
* @example
|
|
1794
|
+
* ```typescript
|
|
1795
|
+
* const groups = await client.following.getFollowGroups();
|
|
1796
|
+
* groups.forEach(group => {
|
|
1797
|
+
* console.log(`${group.name}: ${group.count} items`);
|
|
1798
|
+
* });
|
|
1799
|
+
* ```
|
|
1800
|
+
*/
|
|
1801
|
+
async getFollowGroups() {
|
|
1802
|
+
const response = await this.client.get("/v1/following/groups");
|
|
1803
|
+
return response.groups || [];
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Get a follow group by ID
|
|
1807
|
+
*
|
|
1808
|
+
* @param groupId - Group ID
|
|
1809
|
+
* @returns Group information including group_id, name, and count
|
|
1810
|
+
*
|
|
1811
|
+
* @example
|
|
1812
|
+
* ```typescript
|
|
1813
|
+
* const group = await client.following.getFollowGroup('group_123');
|
|
1814
|
+
* console.log(`${group.name}: ${group.count} items`);
|
|
1815
|
+
* ```
|
|
1816
|
+
*/
|
|
1817
|
+
async getFollowGroup(groupId) {
|
|
1818
|
+
return this.client.get(
|
|
1819
|
+
`/v1/following/groups/${groupId}`
|
|
1820
|
+
);
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Update a follow group
|
|
1824
|
+
*
|
|
1825
|
+
* @param groupId - Group ID
|
|
1826
|
+
* @param name - New group name
|
|
1827
|
+
* @returns Updated group information
|
|
1828
|
+
*
|
|
1829
|
+
* @example
|
|
1830
|
+
* ```typescript
|
|
1831
|
+
* const result = await client.following.updateFollowGroup('group_123', 'New Name');
|
|
1832
|
+
* console.log(`Updated: ${result.name}`);
|
|
1833
|
+
* ```
|
|
1834
|
+
*/
|
|
1835
|
+
async updateFollowGroup(groupId, name) {
|
|
1836
|
+
const json = {};
|
|
1837
|
+
if (name !== void 0) {
|
|
1838
|
+
json.name = name;
|
|
1839
|
+
}
|
|
1840
|
+
return this.client.post(
|
|
1841
|
+
`/v1/following/groups/${groupId}`,
|
|
1842
|
+
json
|
|
1843
|
+
);
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Delete a follow group
|
|
1847
|
+
*
|
|
1848
|
+
* @param groupId - Group ID
|
|
1849
|
+
* @returns Status message
|
|
1850
|
+
*
|
|
1851
|
+
* @example
|
|
1852
|
+
* ```typescript
|
|
1853
|
+
* await client.following.deleteFollowGroup('group_123');
|
|
1854
|
+
* ```
|
|
1855
|
+
*/
|
|
1856
|
+
async deleteFollowGroup(groupId) {
|
|
1857
|
+
return this.client.delete(`/v1/following/groups/${groupId}`);
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* Add follows to a group
|
|
1861
|
+
*
|
|
1862
|
+
* @param groupId - Group ID
|
|
1863
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1864
|
+
* follow_type: 1=company, 3=channel
|
|
1865
|
+
* @returns Status message
|
|
1866
|
+
*
|
|
1867
|
+
* @example
|
|
1868
|
+
* ```typescript
|
|
1869
|
+
* await client.following.addFollowsToGroup('group_123', [
|
|
1870
|
+
* { follow_type: 1, follow_value: 'US:TSLA' }
|
|
1871
|
+
* ]);
|
|
1872
|
+
* ```
|
|
1873
|
+
*/
|
|
1874
|
+
async addFollowsToGroup(groupId, followValues) {
|
|
1875
|
+
return this.client.post(`/v1/following/groups/${groupId}/follows`, {
|
|
1876
|
+
follow_values: followValues
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Remove follows from a group
|
|
1881
|
+
*
|
|
1882
|
+
* @param groupId - Group ID
|
|
1883
|
+
* @param followValues - List of follow values to remove (e.g., stock symbols, channel IDs)
|
|
1884
|
+
* @returns Status message
|
|
1885
|
+
*
|
|
1886
|
+
* @example
|
|
1887
|
+
* ```typescript
|
|
1888
|
+
* await client.following.removeFollowsFromGroup('group_123', ['AAPL', 'MSFT']);
|
|
1889
|
+
* ```
|
|
1890
|
+
*/
|
|
1891
|
+
async removeFollowsFromGroup(groupId, followValues) {
|
|
1892
|
+
return this.client.delete(
|
|
1893
|
+
`/v1/following/groups/${groupId}/follows`,
|
|
1894
|
+
{ follow_values: followValues }
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Set follows for a group (replace all existing follows)
|
|
1899
|
+
*
|
|
1900
|
+
* @param groupId - Group ID
|
|
1901
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1902
|
+
* follow_type: 1=company, 3=channel
|
|
1903
|
+
* @returns Status message
|
|
1904
|
+
*
|
|
1905
|
+
* @example
|
|
1906
|
+
* ```typescript
|
|
1907
|
+
* await client.following.setGroupFollows('group_123', [
|
|
1908
|
+
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1909
|
+
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1910
|
+
* ]);
|
|
1911
|
+
* ```
|
|
1912
|
+
*/
|
|
1913
|
+
async setGroupFollows(groupId, followValues) {
|
|
1914
|
+
return this.client.put(`/v1/following/groups/${groupId}/follows`, {
|
|
1915
|
+
follow_values: followValues
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* Get docs for a follow group
|
|
1920
|
+
*
|
|
1921
|
+
* @param groupId - Group ID
|
|
1922
|
+
* @param pageNum - Page number (default: 1)
|
|
1923
|
+
* @param pageSize - Page size (default: 10, max: 100)
|
|
1924
|
+
* @returns docs data including items list, total_count, page_num, and page_size
|
|
1925
|
+
*
|
|
1926
|
+
* @example
|
|
1927
|
+
* ```typescript
|
|
1928
|
+
* const result = await client.following.getFollowGroupDocs('group_123', 1, 20);
|
|
1929
|
+
* console.log(`Total: ${result.total_count}`);
|
|
1930
|
+
* result.items.forEach(doc => {
|
|
1931
|
+
* console.log(doc.title || 'Untitled');
|
|
1932
|
+
* });
|
|
1933
|
+
* ```
|
|
1934
|
+
*/
|
|
1935
|
+
async getFollowGroupDocs(groupId, pageNum = 1, pageSize = 10) {
|
|
1936
|
+
return this.client.get(`/v1/following/groups/${groupId}/docs`, {
|
|
1937
|
+
page_num: pageNum,
|
|
1938
|
+
page_size: pageSize
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
};
|
|
1942
|
+
|
|
1933
1943
|
// src/types.ts
|
|
1934
1944
|
var ReportifyError = class extends Error {
|
|
1935
1945
|
statusCode;
|
|
@@ -1983,6 +1993,7 @@ var Reportify = class {
|
|
|
1983
1993
|
kb;
|
|
1984
1994
|
timeline;
|
|
1985
1995
|
user;
|
|
1996
|
+
following;
|
|
1986
1997
|
constructor(config) {
|
|
1987
1998
|
if (!config.apiKey) {
|
|
1988
1999
|
throw new AuthenticationError("API key is required");
|
|
@@ -2001,6 +2012,7 @@ var Reportify = class {
|
|
|
2001
2012
|
this.kb = new KBModule(this);
|
|
2002
2013
|
this.timeline = new TimelineModule(this);
|
|
2003
2014
|
this.user = new UserModule(this);
|
|
2015
|
+
this.following = new FollowingModule(this);
|
|
2004
2016
|
}
|
|
2005
2017
|
/**
|
|
2006
2018
|
* Make an HTTP request to the API
|
|
@@ -2115,6 +2127,7 @@ var Reportify = class {
|
|
|
2115
2127
|
ChatModule,
|
|
2116
2128
|
ConceptsModule,
|
|
2117
2129
|
DocsModule,
|
|
2130
|
+
FollowingModule,
|
|
2118
2131
|
KBModule,
|
|
2119
2132
|
NotFoundError,
|
|
2120
2133
|
QuantModule,
|