reportify-sdk 0.3.18 → 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 +143 -122
- package/dist/index.d.ts +143 -122
- package/dist/index.js +202 -184
- package/dist/index.mjs +201 -184
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1168,11 +1168,14 @@ var AgentModule = class {
|
|
|
1168
1168
|
* Create a new agent conversation
|
|
1169
1169
|
*
|
|
1170
1170
|
* @param agentId - Agent ID
|
|
1171
|
-
* @param
|
|
1171
|
+
* @param options - Optional parameters
|
|
1172
|
+
* @param options.title - Conversation title
|
|
1173
|
+
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1172
1174
|
*/
|
|
1173
|
-
async createConversation(agentId,
|
|
1175
|
+
async createConversation(agentId, options = {}) {
|
|
1174
1176
|
const body = { agent_id: agentId };
|
|
1175
|
-
if (title) body.title = title;
|
|
1177
|
+
if (options.title) body.title = options.title;
|
|
1178
|
+
if (options.conversationType) body.conversation_type = options.conversationType;
|
|
1176
1179
|
const response = await this.client.post("/v1/agent/conversations", body);
|
|
1177
1180
|
return {
|
|
1178
1181
|
id: response.id,
|
|
@@ -1191,11 +1194,15 @@ var AgentModule = class {
|
|
|
1191
1194
|
* @param conversationId - Conversation ID
|
|
1192
1195
|
* @param message - User message
|
|
1193
1196
|
* @param options - Chat options
|
|
1197
|
+
* @param options.documents - Related documents
|
|
1198
|
+
* @param options.stream - Whether to use streaming response (default: true)
|
|
1199
|
+
* @param options.background - Whether to run agent task in background (default: false). When true, returns immediately without waiting for events.
|
|
1194
1200
|
*/
|
|
1195
1201
|
async chat(conversationId, message, options = {}) {
|
|
1196
1202
|
const body = {
|
|
1197
1203
|
message,
|
|
1198
|
-
stream: options.stream ?? true
|
|
1204
|
+
stream: options.stream ?? true,
|
|
1205
|
+
background: options.background ?? false
|
|
1199
1206
|
};
|
|
1200
1207
|
if (options.documents) {
|
|
1201
1208
|
body.documents = options.documents.map((doc) => ({
|
|
@@ -1518,186 +1525,6 @@ var UserModule = class {
|
|
|
1518
1525
|
{ symbol }
|
|
1519
1526
|
);
|
|
1520
1527
|
}
|
|
1521
|
-
/**
|
|
1522
|
-
* Create a new follow group
|
|
1523
|
-
*
|
|
1524
|
-
* @param name - Group name
|
|
1525
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1526
|
-
* follow_type: 1=company, 3=channel
|
|
1527
|
-
* @returns Created group information including group_id, name, and count
|
|
1528
|
-
*
|
|
1529
|
-
* @example
|
|
1530
|
-
* ```typescript
|
|
1531
|
-
* const result = await client.user.createFollowGroup('My Stocks', [
|
|
1532
|
-
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1533
|
-
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1534
|
-
* ]);
|
|
1535
|
-
* console.log(`Created group: ${result.group_id}`);
|
|
1536
|
-
* ```
|
|
1537
|
-
*/
|
|
1538
|
-
async createFollowGroup(name, followValues) {
|
|
1539
|
-
const json = { name };
|
|
1540
|
-
if (followValues !== void 0) {
|
|
1541
|
-
json.follow_values = followValues;
|
|
1542
|
-
}
|
|
1543
|
-
return this.client.post(
|
|
1544
|
-
"/v1/tools/user/follow-groups",
|
|
1545
|
-
json
|
|
1546
|
-
);
|
|
1547
|
-
}
|
|
1548
|
-
/**
|
|
1549
|
-
* Get all follow groups for authenticated user
|
|
1550
|
-
*
|
|
1551
|
-
* @returns List of follow groups with group_id, name, and count
|
|
1552
|
-
*
|
|
1553
|
-
* @example
|
|
1554
|
-
* ```typescript
|
|
1555
|
-
* const groups = await client.user.getFollowGroups();
|
|
1556
|
-
* groups.forEach(group => {
|
|
1557
|
-
* console.log(`${group.name}: ${group.count} items`);
|
|
1558
|
-
* });
|
|
1559
|
-
* ```
|
|
1560
|
-
*/
|
|
1561
|
-
async getFollowGroups() {
|
|
1562
|
-
const response = await this.client.get("/v1/tools/user/follow-groups");
|
|
1563
|
-
return response.groups || [];
|
|
1564
|
-
}
|
|
1565
|
-
/**
|
|
1566
|
-
* Get a follow group by ID
|
|
1567
|
-
*
|
|
1568
|
-
* @param groupId - Group ID
|
|
1569
|
-
* @returns Group information including group_id, name, and count
|
|
1570
|
-
*
|
|
1571
|
-
* @example
|
|
1572
|
-
* ```typescript
|
|
1573
|
-
* const group = await client.user.getFollowGroup('group_123');
|
|
1574
|
-
* console.log(`${group.name}: ${group.count} items`);
|
|
1575
|
-
* ```
|
|
1576
|
-
*/
|
|
1577
|
-
async getFollowGroup(groupId) {
|
|
1578
|
-
return this.client.get(
|
|
1579
|
-
`/v1/tools/user/follow-groups/${groupId}`
|
|
1580
|
-
);
|
|
1581
|
-
}
|
|
1582
|
-
/**
|
|
1583
|
-
* Update a follow group
|
|
1584
|
-
*
|
|
1585
|
-
* @param groupId - Group ID
|
|
1586
|
-
* @param name - New group name
|
|
1587
|
-
* @returns Updated group information
|
|
1588
|
-
*
|
|
1589
|
-
* @example
|
|
1590
|
-
* ```typescript
|
|
1591
|
-
* const result = await client.user.updateFollowGroup('group_123', 'New Name');
|
|
1592
|
-
* console.log(`Updated: ${result.name}`);
|
|
1593
|
-
* ```
|
|
1594
|
-
*/
|
|
1595
|
-
async updateFollowGroup(groupId, name) {
|
|
1596
|
-
const json = {};
|
|
1597
|
-
if (name !== void 0) {
|
|
1598
|
-
json.name = name;
|
|
1599
|
-
}
|
|
1600
|
-
return this.client.post(
|
|
1601
|
-
`/v1/tools/user/follow-groups/${groupId}`,
|
|
1602
|
-
json
|
|
1603
|
-
);
|
|
1604
|
-
}
|
|
1605
|
-
/**
|
|
1606
|
-
* Delete a follow group
|
|
1607
|
-
*
|
|
1608
|
-
* @param groupId - Group ID
|
|
1609
|
-
* @returns Status message
|
|
1610
|
-
*
|
|
1611
|
-
* @example
|
|
1612
|
-
* ```typescript
|
|
1613
|
-
* await client.user.deleteFollowGroup('group_123');
|
|
1614
|
-
* ```
|
|
1615
|
-
*/
|
|
1616
|
-
async deleteFollowGroup(groupId) {
|
|
1617
|
-
return this.client.delete(`/v1/tools/user/follow-groups/${groupId}`);
|
|
1618
|
-
}
|
|
1619
|
-
/**
|
|
1620
|
-
* Add follows to a group
|
|
1621
|
-
*
|
|
1622
|
-
* @param groupId - Group ID
|
|
1623
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1624
|
-
* follow_type: 1=company, 3=channel
|
|
1625
|
-
* @returns Status message
|
|
1626
|
-
*
|
|
1627
|
-
* @example
|
|
1628
|
-
* ```typescript
|
|
1629
|
-
* await client.user.addFollowsToGroup('group_123', [
|
|
1630
|
-
* { follow_type: 1, follow_value: 'US:TSLA' }
|
|
1631
|
-
* ]);
|
|
1632
|
-
* ```
|
|
1633
|
-
*/
|
|
1634
|
-
async addFollowsToGroup(groupId, followValues) {
|
|
1635
|
-
return this.client.post(`/v1/tools/user/follow-groups/${groupId}/follows`, {
|
|
1636
|
-
follow_values: followValues
|
|
1637
|
-
});
|
|
1638
|
-
}
|
|
1639
|
-
/**
|
|
1640
|
-
* Remove follows from a group
|
|
1641
|
-
*
|
|
1642
|
-
* @param groupId - Group ID
|
|
1643
|
-
* @param followValues - List of follow values to remove (e.g., stock symbols, channel IDs)
|
|
1644
|
-
* @returns Status message
|
|
1645
|
-
*
|
|
1646
|
-
* @example
|
|
1647
|
-
* ```typescript
|
|
1648
|
-
* await client.user.removeFollowsFromGroup('group_123', ['AAPL', 'MSFT']);
|
|
1649
|
-
* ```
|
|
1650
|
-
*/
|
|
1651
|
-
async removeFollowsFromGroup(groupId, followValues) {
|
|
1652
|
-
return this.client.delete(
|
|
1653
|
-
`/v1/tools/user/follow-groups/${groupId}/follows`,
|
|
1654
|
-
{ follow_values: followValues }
|
|
1655
|
-
);
|
|
1656
|
-
}
|
|
1657
|
-
/**
|
|
1658
|
-
* Set follows for a group (replace all existing follows)
|
|
1659
|
-
*
|
|
1660
|
-
* @param groupId - Group ID
|
|
1661
|
-
* @param followValues - List of follow values (each with 'follow_type' as int and 'follow_value' as string)
|
|
1662
|
-
* follow_type: 1=company, 3=channel
|
|
1663
|
-
* @returns Status message
|
|
1664
|
-
*
|
|
1665
|
-
* @example
|
|
1666
|
-
* ```typescript
|
|
1667
|
-
* await client.user.setGroupFollows('group_123', [
|
|
1668
|
-
* { follow_type: 1, follow_value: 'US:AAPL' },
|
|
1669
|
-
* { follow_type: 1, follow_value: 'HK:00700' }
|
|
1670
|
-
* ]);
|
|
1671
|
-
* ```
|
|
1672
|
-
*/
|
|
1673
|
-
async setGroupFollows(groupId, followValues) {
|
|
1674
|
-
return this.client.put(`/v1/tools/user/follow-groups/${groupId}/follows`, {
|
|
1675
|
-
follow_values: followValues
|
|
1676
|
-
});
|
|
1677
|
-
}
|
|
1678
|
-
/**
|
|
1679
|
-
* Get reports for a follow group
|
|
1680
|
-
*
|
|
1681
|
-
* @param groupId - Group ID
|
|
1682
|
-
* @param pageNum - Page number (default: 1)
|
|
1683
|
-
* @param pageSize - Page size (default: 10, max: 100)
|
|
1684
|
-
* @returns Report data including items list, total_count, page_num, and page_size
|
|
1685
|
-
*
|
|
1686
|
-
* @example
|
|
1687
|
-
* ```typescript
|
|
1688
|
-
* const result = await client.user.getGroupReports('group_123', 1, 20);
|
|
1689
|
-
* console.log(`Total: ${result.total_count}`);
|
|
1690
|
-
* result.items.forEach(report => {
|
|
1691
|
-
* console.log(report.title || 'Untitled');
|
|
1692
|
-
* });
|
|
1693
|
-
* ```
|
|
1694
|
-
*/
|
|
1695
|
-
async getGroupReports(groupId, pageNum = 1, pageSize = 10) {
|
|
1696
|
-
return this.client.get(`/v1/tools/user/follow-groups/${groupId}/reports`, {
|
|
1697
|
-
page_num: pageNum,
|
|
1698
|
-
page_size: pageSize
|
|
1699
|
-
});
|
|
1700
|
-
}
|
|
1701
1528
|
};
|
|
1702
1529
|
|
|
1703
1530
|
// src/search.ts
|
|
@@ -1881,6 +1708,193 @@ var SearchModule = class {
|
|
|
1881
1708
|
}
|
|
1882
1709
|
};
|
|
1883
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
|
+
|
|
1884
1898
|
// src/types.ts
|
|
1885
1899
|
var ReportifyError = class extends Error {
|
|
1886
1900
|
statusCode;
|
|
@@ -1934,6 +1948,7 @@ var Reportify = class {
|
|
|
1934
1948
|
kb;
|
|
1935
1949
|
timeline;
|
|
1936
1950
|
user;
|
|
1951
|
+
following;
|
|
1937
1952
|
constructor(config) {
|
|
1938
1953
|
if (!config.apiKey) {
|
|
1939
1954
|
throw new AuthenticationError("API key is required");
|
|
@@ -1952,6 +1967,7 @@ var Reportify = class {
|
|
|
1952
1967
|
this.kb = new KBModule(this);
|
|
1953
1968
|
this.timeline = new TimelineModule(this);
|
|
1954
1969
|
this.user = new UserModule(this);
|
|
1970
|
+
this.following = new FollowingModule(this);
|
|
1955
1971
|
}
|
|
1956
1972
|
/**
|
|
1957
1973
|
* Make an HTTP request to the API
|
|
@@ -2065,6 +2081,7 @@ export {
|
|
|
2065
2081
|
ChatModule,
|
|
2066
2082
|
ConceptsModule,
|
|
2067
2083
|
DocsModule,
|
|
2084
|
+
FollowingModule,
|
|
2068
2085
|
KBModule,
|
|
2069
2086
|
NotFoundError,
|
|
2070
2087
|
QuantModule,
|