@postpeer/node 0.8.4 → 0.8.6
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 +12 -0
- package/dist/index.cjs +158 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1192 -130
- package/dist/index.d.ts +1192 -130
- package/dist/index.js +158 -1
- package/dist/index.js.map +1 -1
- package/package.json +16 -14
package/dist/index.js
CHANGED
|
@@ -1138,6 +1138,8 @@ var Notifications = class extends HeyApiClient {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
/**
|
|
1140
1140
|
* Create a notification subscription
|
|
1141
|
+
*
|
|
1142
|
+
* Create an email or webhook subscription. See the [webhook guide](/docs/webhooks) for request headers, payload fields, and signature verification.
|
|
1141
1143
|
*/
|
|
1142
1144
|
create(options) {
|
|
1143
1145
|
return (options.client ?? this.client).post({
|
|
@@ -1287,6 +1289,22 @@ var Posts = class extends HeyApiClient {
|
|
|
1287
1289
|
}
|
|
1288
1290
|
});
|
|
1289
1291
|
}
|
|
1292
|
+
/**
|
|
1293
|
+
* Retry the failed platforms of a post
|
|
1294
|
+
*
|
|
1295
|
+
* Re-publish only the platform targets that failed on a post. Omit scheduledFor to retry immediately, or pass scheduledFor (ISO 8601) to schedule the retry. Retried platforms are charged credits (they were refunded when they failed) and refunded again if they fail. Already-published platforms are never re-posted.
|
|
1296
|
+
*/
|
|
1297
|
+
retry(options) {
|
|
1298
|
+
return (options.client ?? this.client).post({
|
|
1299
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1300
|
+
url: "/v1/posts/{postId}/retry",
|
|
1301
|
+
...options,
|
|
1302
|
+
headers: {
|
|
1303
|
+
"Content-Type": "application/json",
|
|
1304
|
+
...options.headers
|
|
1305
|
+
}
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1290
1308
|
/**
|
|
1291
1309
|
* Delete a post by ID
|
|
1292
1310
|
*/
|
|
@@ -1331,6 +1349,47 @@ var Media = class extends HeyApiClient {
|
|
|
1331
1349
|
});
|
|
1332
1350
|
}
|
|
1333
1351
|
};
|
|
1352
|
+
var Instagram = class extends HeyApiClient {
|
|
1353
|
+
static {
|
|
1354
|
+
__name(this, "Instagram");
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Get Instagram follower count
|
|
1358
|
+
*
|
|
1359
|
+
* Returns the connected Instagram professional account's live follower count. Historical growth requires daily snapshots and is not included. Each successful call costs 1 credit.
|
|
1360
|
+
*/
|
|
1361
|
+
getFollowerStats(options) {
|
|
1362
|
+
return (options.client ?? this.client).get({
|
|
1363
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1364
|
+
url: "/v1/analytics/instagram/follower-stats",
|
|
1365
|
+
...options
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Get Instagram account insights
|
|
1370
|
+
*
|
|
1371
|
+
* Returns account-wide Instagram insights across feed, stories, explore, and profile activity. The date range defaults to the last 30 days and cannot exceed 90 days. Only reach supports daily time-series output. Missing Meta metrics are omitted rather than reported as zero. Each successful call costs 1 credit.
|
|
1372
|
+
*/
|
|
1373
|
+
getAccountInsights(options) {
|
|
1374
|
+
return (options.client ?? this.client).get({
|
|
1375
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1376
|
+
url: "/v1/analytics/instagram/account-insights",
|
|
1377
|
+
...options
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* Get Instagram demographics
|
|
1382
|
+
*
|
|
1383
|
+
* Returns Instagram follower, engaged-audience, or reached-audience demographics by age, city, country, and/or gender. Meta returns at most 45 entries per dimension, requires a sufficient audience, and may delay data by up to 48 hours. Each call costs 1 credit.
|
|
1384
|
+
*/
|
|
1385
|
+
getDemographics(options) {
|
|
1386
|
+
return (options.client ?? this.client).get({
|
|
1387
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1388
|
+
url: "/v1/analytics/instagram/demographics",
|
|
1389
|
+
...options
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1334
1393
|
var Analytics = class extends HeyApiClient {
|
|
1335
1394
|
static {
|
|
1336
1395
|
__name(this, "Analytics");
|
|
@@ -1347,6 +1406,10 @@ var Analytics = class extends HeyApiClient {
|
|
|
1347
1406
|
...options
|
|
1348
1407
|
});
|
|
1349
1408
|
}
|
|
1409
|
+
_instagram;
|
|
1410
|
+
get instagram() {
|
|
1411
|
+
return this._instagram ??= new Instagram({ client: this.client });
|
|
1412
|
+
}
|
|
1350
1413
|
};
|
|
1351
1414
|
var Usage = class extends HeyApiClient {
|
|
1352
1415
|
static {
|
|
@@ -1459,6 +1522,100 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1459
1522
|
}
|
|
1460
1523
|
});
|
|
1461
1524
|
}
|
|
1525
|
+
/**
|
|
1526
|
+
* List comments on a post
|
|
1527
|
+
*
|
|
1528
|
+
* 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).
|
|
1529
|
+
*/
|
|
1530
|
+
listComments(options) {
|
|
1531
|
+
return (options.client ?? this.client).get({
|
|
1532
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1533
|
+
url: "/v1/comments/",
|
|
1534
|
+
...options
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Create a comment or reply
|
|
1539
|
+
*
|
|
1540
|
+
* 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`).
|
|
1541
|
+
*/
|
|
1542
|
+
createComment(options) {
|
|
1543
|
+
return (options.client ?? this.client).post({
|
|
1544
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1545
|
+
url: "/v1/comments/",
|
|
1546
|
+
...options,
|
|
1547
|
+
headers: {
|
|
1548
|
+
"Content-Type": "application/json",
|
|
1549
|
+
...options.headers
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* Delete a comment
|
|
1555
|
+
*
|
|
1556
|
+
* Delete a comment on a Facebook Page post or Instagram Business post. Not supported on Threads (the API does not allow deleting others' replies).
|
|
1557
|
+
*/
|
|
1558
|
+
deleteComment(options) {
|
|
1559
|
+
return (options.client ?? this.client).delete({
|
|
1560
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1561
|
+
url: "/v1/comments/{commentId}",
|
|
1562
|
+
...options
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Hide or unhide a comment
|
|
1567
|
+
*
|
|
1568
|
+
* Hide or unhide a comment on an Instagram Business post. Pass `hidden: true` to hide, `hidden: false` to unhide. Instagram only.
|
|
1569
|
+
*/
|
|
1570
|
+
hideComment(options) {
|
|
1571
|
+
return (options.client ?? this.client).patch({
|
|
1572
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1573
|
+
url: "/v1/comments/{commentId}",
|
|
1574
|
+
...options,
|
|
1575
|
+
headers: {
|
|
1576
|
+
"Content-Type": "application/json",
|
|
1577
|
+
...options.headers
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* List conversations
|
|
1583
|
+
*
|
|
1584
|
+
* List DM conversations for a connected Instagram Business account. Requires instagram_business_manage_messages.
|
|
1585
|
+
*/
|
|
1586
|
+
listConversations(options) {
|
|
1587
|
+
return (options.client ?? this.client).get({
|
|
1588
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1589
|
+
url: "/v1/messages/",
|
|
1590
|
+
...options
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Send a message
|
|
1595
|
+
*
|
|
1596
|
+
* Send a DM reply on Instagram.
|
|
1597
|
+
*/
|
|
1598
|
+
sendMessage(options) {
|
|
1599
|
+
return (options.client ?? this.client).post({
|
|
1600
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1601
|
+
url: "/v1/messages/",
|
|
1602
|
+
...options,
|
|
1603
|
+
headers: {
|
|
1604
|
+
"Content-Type": "application/json",
|
|
1605
|
+
...options.headers
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Get messages in a conversation
|
|
1611
|
+
*/
|
|
1612
|
+
getConversationMessages(options) {
|
|
1613
|
+
return (options.client ?? this.client).get({
|
|
1614
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1615
|
+
url: "/v1/messages/{conversationId}",
|
|
1616
|
+
...options
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1462
1619
|
_health;
|
|
1463
1620
|
get health() {
|
|
1464
1621
|
return this._health ??= new Health({ client: this.client });
|
|
@@ -1652,7 +1809,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
|
|
|
1652
1809
|
}, "createAPIError");
|
|
1653
1810
|
|
|
1654
1811
|
// src/version.ts
|
|
1655
|
-
var VERSION = "0.8.
|
|
1812
|
+
var VERSION = "0.8.6";
|
|
1656
1813
|
|
|
1657
1814
|
// src/client.ts
|
|
1658
1815
|
var DEFAULT_BASE_URL = "https://api.postpeer.dev";
|