@postpeer/node 0.8.5 → 0.9.0
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 +15 -0
- package/README.md +24 -2
- package/dist/index.cjs +309 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1470 -211
- package/dist/index.d.ts +1470 -211
- package/dist/index.js +309 -96
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
- Grouped integration moves, comments, messages, comment automations, post editing and syncing, and LinkedIn lookup into resource-based SDK namespaces.
|
|
6
|
+
- Added creating and editing draft posts, editing scheduled posts through the unified posts API, and Facebook Page Stories.
|
|
7
|
+
- Added syncing posts published outside PostPeer and filtering posts by their source.
|
|
8
|
+
- Added creating, listing, updating, deleting, and inspecting comment automations.
|
|
9
|
+
- Added LinkedIn organization lookup and connected-integration sorting and sync-capability fields.
|
|
10
|
+
|
|
11
|
+
## 0.8.6
|
|
12
|
+
|
|
13
|
+
- Added retrying failed platform targets for a post.
|
|
14
|
+
- Added Instagram follower statistics, account insights, and audience demographics.
|
|
15
|
+
- Added Trial Reels, Reel audio names, and idempotency keys for post creation.
|
|
16
|
+
- Added integration insight-permission status and profile names.
|
|
17
|
+
|
|
3
18
|
## 0.8.5
|
|
4
19
|
|
|
5
20
|
- Added listing, creating, replying to, hiding, unhiding, and deleting comments on supported Meta platforms.
|
package/README.md
CHANGED
|
@@ -62,7 +62,10 @@ client.health.verifyAccessKey();
|
|
|
62
62
|
client.posts.create({ body });
|
|
63
63
|
client.posts.list({ query });
|
|
64
64
|
client.posts.get({ path: { postId } });
|
|
65
|
+
client.posts.edit({ path: { postId }, body });
|
|
65
66
|
client.posts.delete({ path: { postId } });
|
|
67
|
+
client.posts.retry({ path: { postId }, body });
|
|
68
|
+
client.posts.syncExternal({ body });
|
|
66
69
|
client.posts.scheduled.list();
|
|
67
70
|
client.posts.scheduled.edit({ path: { postId }, body });
|
|
68
71
|
client.posts.scheduled.cancel({ path: { postId } });
|
|
@@ -73,8 +76,27 @@ client.connect.facebook.getSelection({ path: { token } });
|
|
|
73
76
|
client.connect.facebook.submitSelection({ path: { token }, body });
|
|
74
77
|
client.connect.integrations.list();
|
|
75
78
|
client.connect.integrations.get({ path: { id } });
|
|
79
|
+
client.connect.integrations.move({ path: { id }, body });
|
|
76
80
|
client.connect.integrations.disconnect({ path: { id } });
|
|
77
81
|
|
|
82
|
+
client.comments.list({ query });
|
|
83
|
+
client.comments.create({ body });
|
|
84
|
+
client.comments.hide({ path: { commentId }, body });
|
|
85
|
+
client.comments.delete({ path: { commentId }, query });
|
|
86
|
+
|
|
87
|
+
client.messages.listConversations({ query });
|
|
88
|
+
client.messages.getConversation({ path: { conversationId }, query });
|
|
89
|
+
client.messages.send({ body });
|
|
90
|
+
|
|
91
|
+
client.commentAutomations.list();
|
|
92
|
+
client.commentAutomations.create({ body });
|
|
93
|
+
client.commentAutomations.update({ path: { id }, body });
|
|
94
|
+
client.commentAutomations.delete({ path: { id } });
|
|
95
|
+
client.commentAutomations.posts.list({ query });
|
|
96
|
+
client.commentAutomations.logs.list({ path: { id }, query });
|
|
97
|
+
|
|
98
|
+
client.linkedin.lookupOrganization({ query });
|
|
99
|
+
|
|
78
100
|
client.profiles.list();
|
|
79
101
|
client.apps.list();
|
|
80
102
|
client.notifications.list();
|
|
@@ -145,8 +167,8 @@ Generated files under `src/generated` must not be edited by hand.
|
|
|
145
167
|
PostPeer uses conservative pre-1.0 versioning:
|
|
146
168
|
|
|
147
169
|
- `0.8.0` is the first Hey API release.
|
|
148
|
-
- Compatible fixes and additions remain
|
|
149
|
-
-
|
|
170
|
+
- Compatible fixes and additions remain within the current minor release.
|
|
171
|
+
- Breaking SDK changes move to the next minor release until `1.0.0`.
|
|
150
172
|
- `1.0.0` will be published only when the SDK contract is considered mature.
|
|
151
173
|
|
|
152
174
|
OpenAPI changes may accumulate before a package release.
|
package/dist/index.cjs
CHANGED
|
@@ -930,6 +930,22 @@ var Integrations = class extends HeyApiClient {
|
|
|
930
930
|
...options
|
|
931
931
|
});
|
|
932
932
|
}
|
|
933
|
+
/**
|
|
934
|
+
* Move an integration to another profile
|
|
935
|
+
*
|
|
936
|
+
* Reassigns an existing integration to another profile in the same project. Pass profileId=null to leave the integration unassigned. OAuth credentials and existing posts are unchanged.
|
|
937
|
+
*/
|
|
938
|
+
move(options) {
|
|
939
|
+
return (options.client ?? this.client).patch({
|
|
940
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
941
|
+
url: "/v1/connect/integrations/{id}",
|
|
942
|
+
...options,
|
|
943
|
+
headers: {
|
|
944
|
+
"Content-Type": "application/json",
|
|
945
|
+
...options.headers
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
}
|
|
933
949
|
};
|
|
934
950
|
var Connect = class extends HeyApiClient {
|
|
935
951
|
static {
|
|
@@ -1009,7 +1025,7 @@ var Profiles = class extends HeyApiClient {
|
|
|
1009
1025
|
/**
|
|
1010
1026
|
* Delete a profile
|
|
1011
1027
|
*
|
|
1012
|
-
* Soft-deletes
|
|
1028
|
+
* Soft-deletes an empty profile. Move or disconnect active integrations before deleting their profile.
|
|
1013
1029
|
*/
|
|
1014
1030
|
delete(options) {
|
|
1015
1031
|
return (options.client ?? this.client).delete({
|
|
@@ -1142,6 +1158,8 @@ var Notifications = class extends HeyApiClient {
|
|
|
1142
1158
|
}
|
|
1143
1159
|
/**
|
|
1144
1160
|
* Create a notification subscription
|
|
1161
|
+
*
|
|
1162
|
+
* Create an email or webhook subscription. See the [webhook guide](/docs/webhooks) for request headers, payload fields, and signature verification.
|
|
1145
1163
|
*/
|
|
1146
1164
|
create(options) {
|
|
1147
1165
|
return (options.client ?? this.client).post({
|
|
@@ -1247,7 +1265,9 @@ var Scheduled = class extends HeyApiClient {
|
|
|
1247
1265
|
/**
|
|
1248
1266
|
* Edit a scheduled post (content, media, platforms, time)
|
|
1249
1267
|
*
|
|
1250
|
-
* Replaces the editable fields of a scheduled post
|
|
1268
|
+
* Deprecated: use PUT /v1/posts/:postId. Replaces the editable fields of a scheduled post and reconciles credits.
|
|
1269
|
+
*
|
|
1270
|
+
* @deprecated
|
|
1251
1271
|
*/
|
|
1252
1272
|
edit(options) {
|
|
1253
1273
|
return (options.client ?? this.client).put({
|
|
@@ -1278,7 +1298,9 @@ var Posts = class extends HeyApiClient {
|
|
|
1278
1298
|
});
|
|
1279
1299
|
}
|
|
1280
1300
|
/**
|
|
1281
|
-
*
|
|
1301
|
+
* Create, publish, or schedule a post
|
|
1302
|
+
*
|
|
1303
|
+
* Set saveAsDraft=true to save without accounts or credits, publishNow=true to publish immediately, or provide scheduledFor to schedule it.
|
|
1282
1304
|
*/
|
|
1283
1305
|
create(options) {
|
|
1284
1306
|
return (options.client ?? this.client).post({
|
|
@@ -1291,6 +1313,22 @@ var Posts = class extends HeyApiClient {
|
|
|
1291
1313
|
}
|
|
1292
1314
|
});
|
|
1293
1315
|
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Retry the failed platforms of a post
|
|
1318
|
+
*
|
|
1319
|
+
* 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.
|
|
1320
|
+
*/
|
|
1321
|
+
retry(options) {
|
|
1322
|
+
return (options.client ?? this.client).post({
|
|
1323
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1324
|
+
url: "/v1/posts/{postId}/retry",
|
|
1325
|
+
...options,
|
|
1326
|
+
headers: {
|
|
1327
|
+
"Content-Type": "application/json",
|
|
1328
|
+
...options.headers
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1294
1332
|
/**
|
|
1295
1333
|
* Delete a post by ID
|
|
1296
1334
|
*/
|
|
@@ -1311,6 +1349,38 @@ var Posts = class extends HeyApiClient {
|
|
|
1311
1349
|
...options
|
|
1312
1350
|
});
|
|
1313
1351
|
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Edit a draft or scheduled post
|
|
1354
|
+
*
|
|
1355
|
+
* Replaces an editable post. Drafts remain drafts with saveAsDraft=true, publish immediately with publishNow=true, or become scheduled with scheduledFor. Scheduled posts keep their schedule.
|
|
1356
|
+
*/
|
|
1357
|
+
edit(options) {
|
|
1358
|
+
return (options.client ?? this.client).put({
|
|
1359
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1360
|
+
url: "/v1/posts/{postId}",
|
|
1361
|
+
...options,
|
|
1362
|
+
headers: {
|
|
1363
|
+
"Content-Type": "application/json",
|
|
1364
|
+
...options.headers
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Sync recent posts published outside PostPeer
|
|
1370
|
+
*
|
|
1371
|
+
* Fetches at most the 50 most recent posts from one connected account and stores posts published outside PostPeer. Existing PostPeer posts are updated instead of duplicated. Provide url or postId to verify one post. Requests are debounced per account for 15 seconds. Supported accounts: Twitter, YouTube, Pinterest, LinkedIn organization pages, TikTok, Facebook, Instagram, Threads, and Google Business.
|
|
1372
|
+
*/
|
|
1373
|
+
syncExternal(options) {
|
|
1374
|
+
return (options.client ?? this.client).post({
|
|
1375
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1376
|
+
url: "/v1/posts/sync-external",
|
|
1377
|
+
...options,
|
|
1378
|
+
headers: {
|
|
1379
|
+
"Content-Type": "application/json",
|
|
1380
|
+
...options.headers
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1314
1384
|
_scheduled;
|
|
1315
1385
|
get scheduled() {
|
|
1316
1386
|
return this._scheduled ??= new Scheduled({ client: this.client });
|
|
@@ -1335,85 +1405,93 @@ var Media = class extends HeyApiClient {
|
|
|
1335
1405
|
});
|
|
1336
1406
|
}
|
|
1337
1407
|
};
|
|
1338
|
-
var
|
|
1408
|
+
var Instagram = class extends HeyApiClient {
|
|
1339
1409
|
static {
|
|
1340
|
-
__name(this, "
|
|
1410
|
+
__name(this, "Instagram");
|
|
1341
1411
|
}
|
|
1342
1412
|
/**
|
|
1343
|
-
* Get
|
|
1413
|
+
* Get Instagram follower count
|
|
1344
1414
|
*
|
|
1345
|
-
*
|
|
1415
|
+
* 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.
|
|
1346
1416
|
*/
|
|
1347
|
-
|
|
1348
|
-
return (options
|
|
1417
|
+
getFollowerStats(options) {
|
|
1418
|
+
return (options.client ?? this.client).get({
|
|
1349
1419
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1350
|
-
url: "/v1/analytics/",
|
|
1420
|
+
url: "/v1/analytics/instagram/follower-stats",
|
|
1351
1421
|
...options
|
|
1352
1422
|
});
|
|
1353
1423
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1424
|
+
/**
|
|
1425
|
+
* Get Instagram account insights
|
|
1426
|
+
*
|
|
1427
|
+
* 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.
|
|
1428
|
+
*/
|
|
1429
|
+
getAccountInsights(options) {
|
|
1430
|
+
return (options.client ?? this.client).get({
|
|
1431
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1432
|
+
url: "/v1/analytics/instagram/account-insights",
|
|
1433
|
+
...options
|
|
1434
|
+
});
|
|
1358
1435
|
}
|
|
1359
1436
|
/**
|
|
1360
|
-
* Get
|
|
1437
|
+
* Get Instagram demographics
|
|
1361
1438
|
*
|
|
1362
|
-
* Returns
|
|
1439
|
+
* 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.
|
|
1363
1440
|
*/
|
|
1364
|
-
|
|
1365
|
-
return (options
|
|
1441
|
+
getDemographics(options) {
|
|
1442
|
+
return (options.client ?? this.client).get({
|
|
1366
1443
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1367
|
-
url: "/v1/
|
|
1444
|
+
url: "/v1/analytics/instagram/demographics",
|
|
1368
1445
|
...options
|
|
1369
1446
|
});
|
|
1370
1447
|
}
|
|
1371
1448
|
};
|
|
1372
|
-
var
|
|
1449
|
+
var Analytics = class extends HeyApiClient {
|
|
1373
1450
|
static {
|
|
1374
|
-
__name(this, "
|
|
1451
|
+
__name(this, "Analytics");
|
|
1375
1452
|
}
|
|
1376
1453
|
/**
|
|
1377
|
-
*
|
|
1454
|
+
* Get post analytics
|
|
1455
|
+
*
|
|
1456
|
+
* With postId, returns analytics for a single post. Without postId, returns a paginated list of published posts with analytics. Accepts both PostPeer post IDs and external platform post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. Each call costs 1 credit.
|
|
1378
1457
|
*/
|
|
1379
|
-
|
|
1458
|
+
get(options) {
|
|
1380
1459
|
return (options?.client ?? this.client).get({
|
|
1381
1460
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1382
|
-
url: "/v1/
|
|
1461
|
+
url: "/v1/analytics/",
|
|
1383
1462
|
...options
|
|
1384
1463
|
});
|
|
1385
1464
|
}
|
|
1465
|
+
_instagram;
|
|
1466
|
+
get instagram() {
|
|
1467
|
+
return this._instagram ??= new Instagram({ client: this.client });
|
|
1468
|
+
}
|
|
1386
1469
|
};
|
|
1387
|
-
var
|
|
1470
|
+
var Comments = class extends HeyApiClient {
|
|
1388
1471
|
static {
|
|
1389
|
-
__name(this, "
|
|
1472
|
+
__name(this, "Comments");
|
|
1390
1473
|
}
|
|
1391
1474
|
/**
|
|
1392
|
-
*
|
|
1475
|
+
* List comments on a post
|
|
1393
1476
|
*
|
|
1394
|
-
*
|
|
1477
|
+
* Fetch comments (and first-level replies) on a post from a connected Facebook Page, Instagram Business account, Threads account, or LinkedIn account. Requires the account to have the relevant permissions approved (pages_read_user_content for Facebook, instagram_business_manage_comments for Instagram, threads_manage_replies for Threads, Community Management social-feed scopes for LinkedIn).
|
|
1395
1478
|
*/
|
|
1396
|
-
|
|
1397
|
-
return (options
|
|
1479
|
+
list(options) {
|
|
1480
|
+
return (options.client ?? this.client).get({
|
|
1398
1481
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1399
|
-
url: "/v1/
|
|
1482
|
+
url: "/v1/comments/",
|
|
1400
1483
|
...options
|
|
1401
1484
|
});
|
|
1402
1485
|
}
|
|
1403
|
-
};
|
|
1404
|
-
var Ai = class extends HeyApiClient {
|
|
1405
|
-
static {
|
|
1406
|
-
__name(this, "Ai");
|
|
1407
|
-
}
|
|
1408
1486
|
/**
|
|
1409
|
-
*
|
|
1487
|
+
* Create a comment or reply
|
|
1410
1488
|
*
|
|
1411
|
-
*
|
|
1489
|
+
* Post a top-level comment on an Instagram, Facebook, or LinkedIn post, or a top-level post on Threads (provide `postId`), or reply to an existing comment on Facebook, Instagram, Threads, or LinkedIn (provide `commentId`).
|
|
1412
1490
|
*/
|
|
1413
|
-
|
|
1491
|
+
create(options) {
|
|
1414
1492
|
return (options.client ?? this.client).post({
|
|
1415
1493
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1416
|
-
url: "/v1/
|
|
1494
|
+
url: "/v1/comments/",
|
|
1417
1495
|
...options,
|
|
1418
1496
|
headers: {
|
|
1419
1497
|
"Content-Type": "application/json",
|
|
@@ -1422,14 +1500,26 @@ var Ai = class extends HeyApiClient {
|
|
|
1422
1500
|
});
|
|
1423
1501
|
}
|
|
1424
1502
|
/**
|
|
1425
|
-
*
|
|
1503
|
+
* Delete a comment
|
|
1426
1504
|
*
|
|
1427
|
-
*
|
|
1505
|
+
* Delete a comment on a Facebook Page post, Instagram Business post, or LinkedIn post. Not supported on Threads (the API does not allow deleting others' replies).
|
|
1428
1506
|
*/
|
|
1429
|
-
|
|
1430
|
-
return (options.client ?? this.client).
|
|
1507
|
+
delete(options) {
|
|
1508
|
+
return (options.client ?? this.client).delete({
|
|
1431
1509
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1432
|
-
url: "/v1/
|
|
1510
|
+
url: "/v1/comments/{commentId}",
|
|
1511
|
+
...options
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
/**
|
|
1515
|
+
* Hide or unhide a comment
|
|
1516
|
+
*
|
|
1517
|
+
* Hide or unhide a comment on an Instagram Business post. Pass `hidden: true` to hide, `hidden: false` to unhide. Instagram only.
|
|
1518
|
+
*/
|
|
1519
|
+
hide(options) {
|
|
1520
|
+
return (options.client ?? this.client).patch({
|
|
1521
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1522
|
+
url: "/v1/comments/{commentId}",
|
|
1433
1523
|
...options,
|
|
1434
1524
|
headers: {
|
|
1435
1525
|
"Content-Type": "application/json",
|
|
@@ -1438,24 +1528,31 @@ var Ai = class extends HeyApiClient {
|
|
|
1438
1528
|
});
|
|
1439
1529
|
}
|
|
1440
1530
|
};
|
|
1441
|
-
var
|
|
1531
|
+
var Messages = class extends HeyApiClient {
|
|
1442
1532
|
static {
|
|
1443
|
-
__name(this, "
|
|
1533
|
+
__name(this, "Messages");
|
|
1444
1534
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1535
|
+
/**
|
|
1536
|
+
* List conversations
|
|
1537
|
+
*
|
|
1538
|
+
* List DM conversations for a connected Instagram Business account. Requires instagram_business_manage_messages.
|
|
1539
|
+
*/
|
|
1540
|
+
listConversations(options) {
|
|
1541
|
+
return (options.client ?? this.client).get({
|
|
1542
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1543
|
+
url: "/v1/messages/",
|
|
1544
|
+
...options
|
|
1545
|
+
});
|
|
1449
1546
|
}
|
|
1450
1547
|
/**
|
|
1451
|
-
*
|
|
1548
|
+
* Send a message
|
|
1452
1549
|
*
|
|
1453
|
-
*
|
|
1550
|
+
* Send a DM reply on Instagram.
|
|
1454
1551
|
*/
|
|
1455
|
-
|
|
1456
|
-
return (options.client ?? this.client).
|
|
1552
|
+
send(options) {
|
|
1553
|
+
return (options.client ?? this.client).post({
|
|
1457
1554
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1458
|
-
url: "/v1/
|
|
1555
|
+
url: "/v1/messages/",
|
|
1459
1556
|
...options,
|
|
1460
1557
|
headers: {
|
|
1461
1558
|
"Content-Type": "application/json",
|
|
@@ -1464,26 +1561,55 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1464
1561
|
});
|
|
1465
1562
|
}
|
|
1466
1563
|
/**
|
|
1467
|
-
*
|
|
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).
|
|
1564
|
+
* Get messages in a conversation
|
|
1470
1565
|
*/
|
|
1471
|
-
|
|
1566
|
+
getConversation(options) {
|
|
1472
1567
|
return (options.client ?? this.client).get({
|
|
1473
1568
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1474
|
-
url: "/v1/
|
|
1569
|
+
url: "/v1/messages/{conversationId}",
|
|
1475
1570
|
...options
|
|
1476
1571
|
});
|
|
1477
1572
|
}
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1573
|
+
};
|
|
1574
|
+
var Posts2 = class extends HeyApiClient {
|
|
1575
|
+
static {
|
|
1576
|
+
__name(this, "Posts2");
|
|
1577
|
+
}
|
|
1578
|
+
list(options) {
|
|
1579
|
+
return (options.client ?? this.client).get({
|
|
1580
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1581
|
+
url: "/v1/comment-automations/posts",
|
|
1582
|
+
...options
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
};
|
|
1586
|
+
var Logs = class extends HeyApiClient {
|
|
1587
|
+
static {
|
|
1588
|
+
__name(this, "Logs");
|
|
1589
|
+
}
|
|
1590
|
+
list(options) {
|
|
1591
|
+
return (options.client ?? this.client).get({
|
|
1592
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1593
|
+
url: "/v1/comment-automations/{id}/logs",
|
|
1594
|
+
...options
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
var CommentAutomations = class extends HeyApiClient {
|
|
1599
|
+
static {
|
|
1600
|
+
__name(this, "CommentAutomations");
|
|
1601
|
+
}
|
|
1602
|
+
list(options) {
|
|
1603
|
+
return (options?.client ?? this.client).get({
|
|
1604
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1605
|
+
url: "/v1/comment-automations/",
|
|
1606
|
+
...options
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
create(options) {
|
|
1484
1610
|
return (options.client ?? this.client).post({
|
|
1485
1611
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1486
|
-
url: "/v1/
|
|
1612
|
+
url: "/v1/comment-automations/",
|
|
1487
1613
|
...options,
|
|
1488
1614
|
headers: {
|
|
1489
1615
|
"Content-Type": "application/json",
|
|
@@ -1491,27 +1617,17 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1491
1617
|
}
|
|
1492
1618
|
});
|
|
1493
1619
|
}
|
|
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) {
|
|
1620
|
+
delete(options) {
|
|
1500
1621
|
return (options.client ?? this.client).delete({
|
|
1501
1622
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1502
|
-
url: "/v1/
|
|
1623
|
+
url: "/v1/comment-automations/{id}",
|
|
1503
1624
|
...options
|
|
1504
1625
|
});
|
|
1505
1626
|
}
|
|
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) {
|
|
1627
|
+
update(options) {
|
|
1512
1628
|
return (options.client ?? this.client).patch({
|
|
1513
1629
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1514
|
-
url: "/v1/
|
|
1630
|
+
url: "/v1/comment-automations/{id}",
|
|
1515
1631
|
...options,
|
|
1516
1632
|
headers: {
|
|
1517
1633
|
"Content-Type": "application/json",
|
|
@@ -1519,27 +1635,92 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1519
1635
|
}
|
|
1520
1636
|
});
|
|
1521
1637
|
}
|
|
1638
|
+
_posts;
|
|
1639
|
+
get posts() {
|
|
1640
|
+
return this._posts ??= new Posts2({ client: this.client });
|
|
1641
|
+
}
|
|
1642
|
+
_logs;
|
|
1643
|
+
get logs() {
|
|
1644
|
+
return this._logs ??= new Logs({ client: this.client });
|
|
1645
|
+
}
|
|
1646
|
+
};
|
|
1647
|
+
var Usage = class extends HeyApiClient {
|
|
1648
|
+
static {
|
|
1649
|
+
__name(this, "Usage");
|
|
1650
|
+
}
|
|
1522
1651
|
/**
|
|
1523
|
-
*
|
|
1652
|
+
* Get credit usage
|
|
1524
1653
|
*
|
|
1525
|
-
*
|
|
1654
|
+
* Returns credit usage history for the project. Without filters, returns project-level totals. Add `profileId` to scope to a specific profile, or `integrationId` to scope to a specific connected account. Use `from`/`to` (YYYY-MM) to slice the history. Each entry contains the monthly credit count and a per-platform breakdown.
|
|
1526
1655
|
*/
|
|
1527
|
-
|
|
1656
|
+
get(options) {
|
|
1657
|
+
return (options?.client ?? this.client).get({
|
|
1658
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1659
|
+
url: "/v1/usage/",
|
|
1660
|
+
...options
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
var Pinterest = class extends HeyApiClient {
|
|
1665
|
+
static {
|
|
1666
|
+
__name(this, "Pinterest");
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
* List Pinterest boards for a connected account
|
|
1670
|
+
*/
|
|
1671
|
+
getBoards(options) {
|
|
1672
|
+
return (options?.client ?? this.client).get({
|
|
1673
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1674
|
+
url: "/v1/pinterest/boards",
|
|
1675
|
+
...options
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
var Tiktok = class extends HeyApiClient {
|
|
1680
|
+
static {
|
|
1681
|
+
__name(this, "Tiktok");
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Fetch TikTok creator info for a connected account
|
|
1685
|
+
*
|
|
1686
|
+
* Proxies TikTok's /v2/post/publish/creator_info/query/ endpoint. Use the returned `privacyLevelOptions`, `commentDisabled`, `duetDisabled`, `stitchDisabled`, and `maxVideoPostDurationSec` to build a compliant "Post to TikTok" UX.
|
|
1687
|
+
*/
|
|
1688
|
+
getCreatorInfo(options) {
|
|
1689
|
+
return (options?.client ?? this.client).get({
|
|
1690
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1691
|
+
url: "/v1/tiktok/creator-info",
|
|
1692
|
+
...options
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
var Linkedin2 = class extends HeyApiClient {
|
|
1697
|
+
static {
|
|
1698
|
+
__name(this, "Linkedin2");
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Find a LinkedIn organization ID and URN by company URL or slug
|
|
1702
|
+
*/
|
|
1703
|
+
lookupOrganization(options) {
|
|
1528
1704
|
return (options.client ?? this.client).get({
|
|
1529
1705
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1530
|
-
url: "/v1/
|
|
1706
|
+
url: "/v1/linkedin/organization-lookup",
|
|
1531
1707
|
...options
|
|
1532
1708
|
});
|
|
1533
1709
|
}
|
|
1710
|
+
};
|
|
1711
|
+
var Ai = class extends HeyApiClient {
|
|
1712
|
+
static {
|
|
1713
|
+
__name(this, "Ai");
|
|
1714
|
+
}
|
|
1534
1715
|
/**
|
|
1535
|
-
*
|
|
1716
|
+
* Generate a social media caption from a description
|
|
1536
1717
|
*
|
|
1537
|
-
*
|
|
1718
|
+
* Generates a caption tailored to the platforms you'll post to. Costs 2 credits per successful generation. Failed calls do not deduct credits.
|
|
1538
1719
|
*/
|
|
1539
|
-
|
|
1720
|
+
write(options) {
|
|
1540
1721
|
return (options.client ?? this.client).post({
|
|
1541
1722
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1542
|
-
url: "/v1/
|
|
1723
|
+
url: "/v1/ai/write",
|
|
1543
1724
|
...options,
|
|
1544
1725
|
headers: {
|
|
1545
1726
|
"Content-Type": "application/json",
|
|
@@ -1548,15 +1729,31 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1548
1729
|
});
|
|
1549
1730
|
}
|
|
1550
1731
|
/**
|
|
1551
|
-
*
|
|
1732
|
+
* Generate a social media image from a description
|
|
1733
|
+
*
|
|
1734
|
+
* Generates a square or vertical image suitable for social media. Costs 10 credits per successful generation. Failed calls do not deduct credits.
|
|
1552
1735
|
*/
|
|
1553
|
-
|
|
1554
|
-
return (options.client ?? this.client).
|
|
1736
|
+
generateImage(options) {
|
|
1737
|
+
return (options.client ?? this.client).post({
|
|
1555
1738
|
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1556
|
-
url: "/v1/
|
|
1557
|
-
...options
|
|
1739
|
+
url: "/v1/ai/image",
|
|
1740
|
+
...options,
|
|
1741
|
+
headers: {
|
|
1742
|
+
"Content-Type": "application/json",
|
|
1743
|
+
...options.headers
|
|
1744
|
+
}
|
|
1558
1745
|
});
|
|
1559
1746
|
}
|
|
1747
|
+
};
|
|
1748
|
+
var PostPeer = class _PostPeer extends HeyApiClient {
|
|
1749
|
+
static {
|
|
1750
|
+
__name(this, "PostPeer");
|
|
1751
|
+
}
|
|
1752
|
+
static __registry = new HeyApiRegistry();
|
|
1753
|
+
constructor(args) {
|
|
1754
|
+
super(args);
|
|
1755
|
+
_PostPeer.__registry.set(this, args?.key);
|
|
1756
|
+
}
|
|
1560
1757
|
_health;
|
|
1561
1758
|
get health() {
|
|
1562
1759
|
return this._health ??= new Health({ client: this.client });
|
|
@@ -1593,6 +1790,18 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1593
1790
|
get analytics() {
|
|
1594
1791
|
return this._analytics ??= new Analytics({ client: this.client });
|
|
1595
1792
|
}
|
|
1793
|
+
_comments;
|
|
1794
|
+
get comments() {
|
|
1795
|
+
return this._comments ??= new Comments({ client: this.client });
|
|
1796
|
+
}
|
|
1797
|
+
_messages;
|
|
1798
|
+
get messages() {
|
|
1799
|
+
return this._messages ??= new Messages({ client: this.client });
|
|
1800
|
+
}
|
|
1801
|
+
_commentAutomations;
|
|
1802
|
+
get commentAutomations() {
|
|
1803
|
+
return this._commentAutomations ??= new CommentAutomations({ client: this.client });
|
|
1804
|
+
}
|
|
1596
1805
|
_usage;
|
|
1597
1806
|
get usage() {
|
|
1598
1807
|
return this._usage ??= new Usage({ client: this.client });
|
|
@@ -1605,6 +1814,10 @@ var PostPeer = class _PostPeer extends HeyApiClient {
|
|
|
1605
1814
|
get tiktok() {
|
|
1606
1815
|
return this._tiktok ??= new Tiktok({ client: this.client });
|
|
1607
1816
|
}
|
|
1817
|
+
_linkedin;
|
|
1818
|
+
get linkedin() {
|
|
1819
|
+
return this._linkedin ??= new Linkedin2({ client: this.client });
|
|
1820
|
+
}
|
|
1608
1821
|
_ai;
|
|
1609
1822
|
get ai() {
|
|
1610
1823
|
return this._ai ??= new Ai({ client: this.client });
|
|
@@ -1750,7 +1963,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
|
|
|
1750
1963
|
}, "createAPIError");
|
|
1751
1964
|
|
|
1752
1965
|
// src/version.ts
|
|
1753
|
-
var VERSION = "0.
|
|
1966
|
+
var VERSION = "0.9.0";
|
|
1754
1967
|
|
|
1755
1968
|
// src/client.ts
|
|
1756
1969
|
var DEFAULT_BASE_URL = "https://api.postpeer.dev";
|