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.mjs
CHANGED
|
@@ -1171,11 +1171,13 @@ var AgentModule = class {
|
|
|
1171
1171
|
* @param options - Optional parameters
|
|
1172
1172
|
* @param options.title - Conversation title
|
|
1173
1173
|
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1174
|
+
* @param options.meta - Metadata dict (optional)
|
|
1174
1175
|
*/
|
|
1175
1176
|
async createConversation(agentId, options = {}) {
|
|
1176
1177
|
const body = { agent_id: agentId };
|
|
1177
1178
|
if (options.title) body.title = options.title;
|
|
1178
1179
|
if (options.conversationType) body.conversation_type = options.conversationType;
|
|
1180
|
+
if (options.meta) body.meta = options.meta;
|
|
1179
1181
|
const response = await this.client.post("/v1/agent/conversations", body);
|
|
1180
1182
|
return {
|
|
1181
1183
|
id: response.id,
|
|
@@ -1525,186 +1527,6 @@ var UserModule = class {
|
|
|
1525
1527
|
{ symbol }
|
|
1526
1528
|
);
|
|
1527
1529
|
}
|
|
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
1530
|
};
|
|
1709
1531
|
|
|
1710
1532
|
// src/search.ts
|
|
@@ -1888,6 +1710,193 @@ var SearchModule = class {
|
|
|
1888
1710
|
}
|
|
1889
1711
|
};
|
|
1890
1712
|
|
|
1713
|
+
// src/following.ts
|
|
1714
|
+
var FollowingModule = class {
|
|
1715
|
+
constructor(client) {
|
|
1716
|
+
this.client = client;
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* Create a new follow group
|
|
1720
|
+
*
|
|
1721
|
+
* @param name - Group name
|
|
1722
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1723
|
+
* follow_type: 1=company, 3=channel
|
|
1724
|
+
* @returns Created group information including group_id, name, and count
|
|
1725
|
+
*
|
|
1726
|
+
* @example
|
|
1727
|
+
* ```typescript
|
|
1728
|
+
* const result = await client.following.createFollowGroup('My Stocks', [
|
|
1729
|
+
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1730
|
+
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1731
|
+
* ]);
|
|
1732
|
+
* console.log(`Created group: ${result.group_id}`);
|
|
1733
|
+
* ```
|
|
1734
|
+
*/
|
|
1735
|
+
async createFollowGroup(name, followValues) {
|
|
1736
|
+
const json = { name };
|
|
1737
|
+
if (followValues !== void 0) {
|
|
1738
|
+
json.follow_values = followValues;
|
|
1739
|
+
}
|
|
1740
|
+
return this.client.post(
|
|
1741
|
+
"/v1/following/groups",
|
|
1742
|
+
json
|
|
1743
|
+
);
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
* Get all follow groups for authenticated user
|
|
1747
|
+
*
|
|
1748
|
+
* @returns List of follow groups with group_id, name, and count
|
|
1749
|
+
*
|
|
1750
|
+
* @example
|
|
1751
|
+
* ```typescript
|
|
1752
|
+
* const groups = await client.following.getFollowGroups();
|
|
1753
|
+
* groups.forEach(group => {
|
|
1754
|
+
* console.log(`${group.name}: ${group.count} items`);
|
|
1755
|
+
* });
|
|
1756
|
+
* ```
|
|
1757
|
+
*/
|
|
1758
|
+
async getFollowGroups() {
|
|
1759
|
+
const response = await this.client.get("/v1/following/groups");
|
|
1760
|
+
return response.groups || [];
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Get a follow group by ID
|
|
1764
|
+
*
|
|
1765
|
+
* @param groupId - Group ID
|
|
1766
|
+
* @returns Group information including group_id, name, and count
|
|
1767
|
+
*
|
|
1768
|
+
* @example
|
|
1769
|
+
* ```typescript
|
|
1770
|
+
* const group = await client.following.getFollowGroup('group_123');
|
|
1771
|
+
* console.log(`${group.name}: ${group.count} items`);
|
|
1772
|
+
* ```
|
|
1773
|
+
*/
|
|
1774
|
+
async getFollowGroup(groupId) {
|
|
1775
|
+
return this.client.get(
|
|
1776
|
+
`/v1/following/groups/${groupId}`
|
|
1777
|
+
);
|
|
1778
|
+
}
|
|
1779
|
+
/**
|
|
1780
|
+
* Update a follow group
|
|
1781
|
+
*
|
|
1782
|
+
* @param groupId - Group ID
|
|
1783
|
+
* @param name - New group name
|
|
1784
|
+
* @returns Updated group information
|
|
1785
|
+
*
|
|
1786
|
+
* @example
|
|
1787
|
+
* ```typescript
|
|
1788
|
+
* const result = await client.following.updateFollowGroup('group_123', 'New Name');
|
|
1789
|
+
* console.log(`Updated: ${result.name}`);
|
|
1790
|
+
* ```
|
|
1791
|
+
*/
|
|
1792
|
+
async updateFollowGroup(groupId, name) {
|
|
1793
|
+
const json = {};
|
|
1794
|
+
if (name !== void 0) {
|
|
1795
|
+
json.name = name;
|
|
1796
|
+
}
|
|
1797
|
+
return this.client.post(
|
|
1798
|
+
`/v1/following/groups/${groupId}`,
|
|
1799
|
+
json
|
|
1800
|
+
);
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* Delete a follow group
|
|
1804
|
+
*
|
|
1805
|
+
* @param groupId - Group ID
|
|
1806
|
+
* @returns Status message
|
|
1807
|
+
*
|
|
1808
|
+
* @example
|
|
1809
|
+
* ```typescript
|
|
1810
|
+
* await client.following.deleteFollowGroup('group_123');
|
|
1811
|
+
* ```
|
|
1812
|
+
*/
|
|
1813
|
+
async deleteFollowGroup(groupId) {
|
|
1814
|
+
return this.client.delete(`/v1/following/groups/${groupId}`);
|
|
1815
|
+
}
|
|
1816
|
+
/**
|
|
1817
|
+
* Add follows to a group
|
|
1818
|
+
*
|
|
1819
|
+
* @param groupId - Group ID
|
|
1820
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1821
|
+
* follow_type: 1=company, 3=channel
|
|
1822
|
+
* @returns Status message
|
|
1823
|
+
*
|
|
1824
|
+
* @example
|
|
1825
|
+
* ```typescript
|
|
1826
|
+
* await client.following.addFollowsToGroup('group_123', [
|
|
1827
|
+
* { follow_type: 1, follow_value: 'US:TSLA' }
|
|
1828
|
+
* ]);
|
|
1829
|
+
* ```
|
|
1830
|
+
*/
|
|
1831
|
+
async addFollowsToGroup(groupId, followValues) {
|
|
1832
|
+
return this.client.post(`/v1/following/groups/${groupId}/follows`, {
|
|
1833
|
+
follow_values: followValues
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* Remove follows from a group
|
|
1838
|
+
*
|
|
1839
|
+
* @param groupId - Group ID
|
|
1840
|
+
* @param followValues - List of follow values to remove (e.g., stock symbols, channel IDs)
|
|
1841
|
+
* @returns Status message
|
|
1842
|
+
*
|
|
1843
|
+
* @example
|
|
1844
|
+
* ```typescript
|
|
1845
|
+
* await client.following.removeFollowsFromGroup('group_123', ['AAPL', 'MSFT']);
|
|
1846
|
+
* ```
|
|
1847
|
+
*/
|
|
1848
|
+
async removeFollowsFromGroup(groupId, followValues) {
|
|
1849
|
+
return this.client.delete(
|
|
1850
|
+
`/v1/following/groups/${groupId}/follows`,
|
|
1851
|
+
{ follow_values: followValues }
|
|
1852
|
+
);
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Set follows for a group (replace all existing follows)
|
|
1856
|
+
*
|
|
1857
|
+
* @param groupId - Group ID
|
|
1858
|
+
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1859
|
+
* follow_type: 1=company, 3=channel
|
|
1860
|
+
* @returns Status message
|
|
1861
|
+
*
|
|
1862
|
+
* @example
|
|
1863
|
+
* ```typescript
|
|
1864
|
+
* await client.following.setGroupFollows('group_123', [
|
|
1865
|
+
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1866
|
+
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1867
|
+
* ]);
|
|
1868
|
+
* ```
|
|
1869
|
+
*/
|
|
1870
|
+
async setGroupFollows(groupId, followValues) {
|
|
1871
|
+
return this.client.put(`/v1/following/groups/${groupId}/follows`, {
|
|
1872
|
+
follow_values: followValues
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* Get docs for a follow group
|
|
1877
|
+
*
|
|
1878
|
+
* @param groupId - Group ID
|
|
1879
|
+
* @param pageNum - Page number (default: 1)
|
|
1880
|
+
* @param pageSize - Page size (default: 10, max: 100)
|
|
1881
|
+
* @returns docs data including items list, total_count, page_num, and page_size
|
|
1882
|
+
*
|
|
1883
|
+
* @example
|
|
1884
|
+
* ```typescript
|
|
1885
|
+
* const result = await client.following.getFollowGroupDocs('group_123', 1, 20);
|
|
1886
|
+
* console.log(`Total: ${result.total_count}`);
|
|
1887
|
+
* result.items.forEach(doc => {
|
|
1888
|
+
* console.log(doc.title || 'Untitled');
|
|
1889
|
+
* });
|
|
1890
|
+
* ```
|
|
1891
|
+
*/
|
|
1892
|
+
async getFollowGroupDocs(groupId, pageNum = 1, pageSize = 10) {
|
|
1893
|
+
return this.client.get(`/v1/following/groups/${groupId}/docs`, {
|
|
1894
|
+
page_num: pageNum,
|
|
1895
|
+
page_size: pageSize
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1891
1900
|
// src/types.ts
|
|
1892
1901
|
var ReportifyError = class extends Error {
|
|
1893
1902
|
statusCode;
|
|
@@ -1941,6 +1950,7 @@ var Reportify = class {
|
|
|
1941
1950
|
kb;
|
|
1942
1951
|
timeline;
|
|
1943
1952
|
user;
|
|
1953
|
+
following;
|
|
1944
1954
|
constructor(config) {
|
|
1945
1955
|
if (!config.apiKey) {
|
|
1946
1956
|
throw new AuthenticationError("API key is required");
|
|
@@ -1959,6 +1969,7 @@ var Reportify = class {
|
|
|
1959
1969
|
this.kb = new KBModule(this);
|
|
1960
1970
|
this.timeline = new TimelineModule(this);
|
|
1961
1971
|
this.user = new UserModule(this);
|
|
1972
|
+
this.following = new FollowingModule(this);
|
|
1962
1973
|
}
|
|
1963
1974
|
/**
|
|
1964
1975
|
* Make an HTTP request to the API
|
|
@@ -2072,6 +2083,7 @@ export {
|
|
|
2072
2083
|
ChatModule,
|
|
2073
2084
|
ConceptsModule,
|
|
2074
2085
|
DocsModule,
|
|
2086
|
+
FollowingModule,
|
|
2075
2087
|
KBModule,
|
|
2076
2088
|
NotFoundError,
|
|
2077
2089
|
QuantModule,
|