@postpeer/node 0.8.4 → 0.8.5
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/CHANGELOG.md +5 -0
- package/dist/index.cjs +95 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +519 -2
- package/dist/index.d.ts +519 -2
- package/dist/index.js +95 -1
- package/dist/index.js.map +1 -1
- package/package.json +16 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.5
|
|
4
|
+
|
|
5
|
+
- Added listing, creating, replying to, hiding, unhiding, and deleting comments on supported Meta platforms.
|
|
6
|
+
- Added listing Instagram conversations, fetching their messages, and sending DM replies.
|
|
7
|
+
|
|
3
8
|
## 0.8.4
|
|
4
9
|
|
|
5
10
|
- Added moving connected integrations between profiles.
|
package/dist/index.cjs
CHANGED
|
@@ -1463,6 +1463,100 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
});
|
|
1465
1465
|
}
|
|
1466
|
+
/**
|
|
1467
|
+
* List comments on a post
|
|
1468
|
+
*
|
|
1469
|
+
* Fetch comments (and first-level replies) on a post from a connected Facebook Page, Instagram Business account, or Threads account. Requires the account to have the relevant Meta permissions approved (pages_read_user_content for Facebook, instagram_business_manage_comments for Instagram, threads_manage_replies for Threads).
|
|
1470
|
+
*/
|
|
1471
|
+
listComments(options) {
|
|
1472
|
+
return (options.client ?? this.client).get({
|
|
1473
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1474
|
+
url: "/v1/comments/",
|
|
1475
|
+
...options
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Create a comment or reply
|
|
1480
|
+
*
|
|
1481
|
+
* Post a top-level comment on an Instagram or Facebook post, or a top-level post on Threads (provide `postId`), or reply to an existing comment on Facebook, Instagram, or Threads (provide `commentId`).
|
|
1482
|
+
*/
|
|
1483
|
+
createComment(options) {
|
|
1484
|
+
return (options.client ?? this.client).post({
|
|
1485
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1486
|
+
url: "/v1/comments/",
|
|
1487
|
+
...options,
|
|
1488
|
+
headers: {
|
|
1489
|
+
"Content-Type": "application/json",
|
|
1490
|
+
...options.headers
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* Delete a comment
|
|
1496
|
+
*
|
|
1497
|
+
* Delete a comment on a Facebook Page post or Instagram Business post. Not supported on Threads (the API does not allow deleting others' replies).
|
|
1498
|
+
*/
|
|
1499
|
+
deleteComment(options) {
|
|
1500
|
+
return (options.client ?? this.client).delete({
|
|
1501
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1502
|
+
url: "/v1/comments/{commentId}",
|
|
1503
|
+
...options
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* Hide or unhide a comment
|
|
1508
|
+
*
|
|
1509
|
+
* Hide or unhide a comment on an Instagram Business post. Pass `hidden: true` to hide, `hidden: false` to unhide. Instagram only.
|
|
1510
|
+
*/
|
|
1511
|
+
hideComment(options) {
|
|
1512
|
+
return (options.client ?? this.client).patch({
|
|
1513
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1514
|
+
url: "/v1/comments/{commentId}",
|
|
1515
|
+
...options,
|
|
1516
|
+
headers: {
|
|
1517
|
+
"Content-Type": "application/json",
|
|
1518
|
+
...options.headers
|
|
1519
|
+
}
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* List conversations
|
|
1524
|
+
*
|
|
1525
|
+
* List DM conversations for a connected Instagram Business account. Requires instagram_business_manage_messages.
|
|
1526
|
+
*/
|
|
1527
|
+
listConversations(options) {
|
|
1528
|
+
return (options.client ?? this.client).get({
|
|
1529
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1530
|
+
url: "/v1/messages/",
|
|
1531
|
+
...options
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Send a message
|
|
1536
|
+
*
|
|
1537
|
+
* Send a DM reply on Instagram.
|
|
1538
|
+
*/
|
|
1539
|
+
sendMessage(options) {
|
|
1540
|
+
return (options.client ?? this.client).post({
|
|
1541
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1542
|
+
url: "/v1/messages/",
|
|
1543
|
+
...options,
|
|
1544
|
+
headers: {
|
|
1545
|
+
"Content-Type": "application/json",
|
|
1546
|
+
...options.headers
|
|
1547
|
+
}
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Get messages in a conversation
|
|
1552
|
+
*/
|
|
1553
|
+
getConversationMessages(options) {
|
|
1554
|
+
return (options.client ?? this.client).get({
|
|
1555
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1556
|
+
url: "/v1/messages/{conversationId}",
|
|
1557
|
+
...options
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1466
1560
|
_health;
|
|
1467
1561
|
get health() {
|
|
1468
1562
|
return this._health ??= new Health({ client: this.client });
|
|
@@ -1656,7 +1750,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
|
|
|
1656
1750
|
}, "createAPIError");
|
|
1657
1751
|
|
|
1658
1752
|
// src/version.ts
|
|
1659
|
-
var VERSION = "0.8.
|
|
1753
|
+
var VERSION = "0.8.5";
|
|
1660
1754
|
|
|
1661
1755
|
// src/client.ts
|
|
1662
1756
|
var DEFAULT_BASE_URL = "https://api.postpeer.dev";
|