@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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.6
4
+
5
+ - Added retrying failed platform targets for a post.
6
+ - Added Instagram follower statistics, account insights, and audience demographics.
7
+ - Added Trial Reels, Reel audio names, and idempotency keys for post creation.
8
+ - Added integration insight-permission status and profile names.
9
+
10
+ ## 0.8.5
11
+
12
+ - Added listing, creating, replying to, hiding, unhiding, and deleting comments on supported Meta platforms.
13
+ - Added listing Instagram conversations, fetching their messages, and sending DM replies.
14
+
3
15
  ## 0.8.4
4
16
 
5
17
  - Added moving connected integrations between profiles.
package/dist/index.cjs CHANGED
@@ -1142,6 +1142,8 @@ var Notifications = class extends HeyApiClient {
1142
1142
  }
1143
1143
  /**
1144
1144
  * Create a notification subscription
1145
+ *
1146
+ * Create an email or webhook subscription. See the [webhook guide](/docs/webhooks) for request headers, payload fields, and signature verification.
1145
1147
  */
1146
1148
  create(options) {
1147
1149
  return (options.client ?? this.client).post({
@@ -1291,6 +1293,22 @@ var Posts = class extends HeyApiClient {
1291
1293
  }
1292
1294
  });
1293
1295
  }
1296
+ /**
1297
+ * Retry the failed platforms of a post
1298
+ *
1299
+ * 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.
1300
+ */
1301
+ retry(options) {
1302
+ return (options.client ?? this.client).post({
1303
+ security: [{ name: "x-access-key", type: "apiKey" }],
1304
+ url: "/v1/posts/{postId}/retry",
1305
+ ...options,
1306
+ headers: {
1307
+ "Content-Type": "application/json",
1308
+ ...options.headers
1309
+ }
1310
+ });
1311
+ }
1294
1312
  /**
1295
1313
  * Delete a post by ID
1296
1314
  */
@@ -1335,6 +1353,47 @@ var Media = class extends HeyApiClient {
1335
1353
  });
1336
1354
  }
1337
1355
  };
1356
+ var Instagram = class extends HeyApiClient {
1357
+ static {
1358
+ __name(this, "Instagram");
1359
+ }
1360
+ /**
1361
+ * Get Instagram follower count
1362
+ *
1363
+ * 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.
1364
+ */
1365
+ getFollowerStats(options) {
1366
+ return (options.client ?? this.client).get({
1367
+ security: [{ name: "x-access-key", type: "apiKey" }],
1368
+ url: "/v1/analytics/instagram/follower-stats",
1369
+ ...options
1370
+ });
1371
+ }
1372
+ /**
1373
+ * Get Instagram account insights
1374
+ *
1375
+ * 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.
1376
+ */
1377
+ getAccountInsights(options) {
1378
+ return (options.client ?? this.client).get({
1379
+ security: [{ name: "x-access-key", type: "apiKey" }],
1380
+ url: "/v1/analytics/instagram/account-insights",
1381
+ ...options
1382
+ });
1383
+ }
1384
+ /**
1385
+ * Get Instagram demographics
1386
+ *
1387
+ * 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.
1388
+ */
1389
+ getDemographics(options) {
1390
+ return (options.client ?? this.client).get({
1391
+ security: [{ name: "x-access-key", type: "apiKey" }],
1392
+ url: "/v1/analytics/instagram/demographics",
1393
+ ...options
1394
+ });
1395
+ }
1396
+ };
1338
1397
  var Analytics = class extends HeyApiClient {
1339
1398
  static {
1340
1399
  __name(this, "Analytics");
@@ -1351,6 +1410,10 @@ var Analytics = class extends HeyApiClient {
1351
1410
  ...options
1352
1411
  });
1353
1412
  }
1413
+ _instagram;
1414
+ get instagram() {
1415
+ return this._instagram ??= new Instagram({ client: this.client });
1416
+ }
1354
1417
  };
1355
1418
  var Usage = class extends HeyApiClient {
1356
1419
  static {
@@ -1463,6 +1526,100 @@ var PostPeer = class _PostPeer extends HeyApiClient {
1463
1526
  }
1464
1527
  });
1465
1528
  }
1529
+ /**
1530
+ * List comments on a post
1531
+ *
1532
+ * 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).
1533
+ */
1534
+ listComments(options) {
1535
+ return (options.client ?? this.client).get({
1536
+ security: [{ name: "x-access-key", type: "apiKey" }],
1537
+ url: "/v1/comments/",
1538
+ ...options
1539
+ });
1540
+ }
1541
+ /**
1542
+ * Create a comment or reply
1543
+ *
1544
+ * 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`).
1545
+ */
1546
+ createComment(options) {
1547
+ return (options.client ?? this.client).post({
1548
+ security: [{ name: "x-access-key", type: "apiKey" }],
1549
+ url: "/v1/comments/",
1550
+ ...options,
1551
+ headers: {
1552
+ "Content-Type": "application/json",
1553
+ ...options.headers
1554
+ }
1555
+ });
1556
+ }
1557
+ /**
1558
+ * Delete a comment
1559
+ *
1560
+ * Delete a comment on a Facebook Page post or Instagram Business post. Not supported on Threads (the API does not allow deleting others' replies).
1561
+ */
1562
+ deleteComment(options) {
1563
+ return (options.client ?? this.client).delete({
1564
+ security: [{ name: "x-access-key", type: "apiKey" }],
1565
+ url: "/v1/comments/{commentId}",
1566
+ ...options
1567
+ });
1568
+ }
1569
+ /**
1570
+ * Hide or unhide a comment
1571
+ *
1572
+ * Hide or unhide a comment on an Instagram Business post. Pass `hidden: true` to hide, `hidden: false` to unhide. Instagram only.
1573
+ */
1574
+ hideComment(options) {
1575
+ return (options.client ?? this.client).patch({
1576
+ security: [{ name: "x-access-key", type: "apiKey" }],
1577
+ url: "/v1/comments/{commentId}",
1578
+ ...options,
1579
+ headers: {
1580
+ "Content-Type": "application/json",
1581
+ ...options.headers
1582
+ }
1583
+ });
1584
+ }
1585
+ /**
1586
+ * List conversations
1587
+ *
1588
+ * List DM conversations for a connected Instagram Business account. Requires instagram_business_manage_messages.
1589
+ */
1590
+ listConversations(options) {
1591
+ return (options.client ?? this.client).get({
1592
+ security: [{ name: "x-access-key", type: "apiKey" }],
1593
+ url: "/v1/messages/",
1594
+ ...options
1595
+ });
1596
+ }
1597
+ /**
1598
+ * Send a message
1599
+ *
1600
+ * Send a DM reply on Instagram.
1601
+ */
1602
+ sendMessage(options) {
1603
+ return (options.client ?? this.client).post({
1604
+ security: [{ name: "x-access-key", type: "apiKey" }],
1605
+ url: "/v1/messages/",
1606
+ ...options,
1607
+ headers: {
1608
+ "Content-Type": "application/json",
1609
+ ...options.headers
1610
+ }
1611
+ });
1612
+ }
1613
+ /**
1614
+ * Get messages in a conversation
1615
+ */
1616
+ getConversationMessages(options) {
1617
+ return (options.client ?? this.client).get({
1618
+ security: [{ name: "x-access-key", type: "apiKey" }],
1619
+ url: "/v1/messages/{conversationId}",
1620
+ ...options
1621
+ });
1622
+ }
1466
1623
  _health;
1467
1624
  get health() {
1468
1625
  return this._health ??= new Health({ client: this.client });
@@ -1656,7 +1813,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
1656
1813
  }, "createAPIError");
1657
1814
 
1658
1815
  // src/version.ts
1659
- var VERSION = "0.8.4";
1816
+ var VERSION = "0.8.6";
1660
1817
 
1661
1818
  // src/client.ts
1662
1819
  var DEFAULT_BASE_URL = "https://api.postpeer.dev";