@postpeer/node 0.8.0 → 0.8.2
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 +9 -0
- package/LICENSE +1 -1
- package/README.md +51 -32
- package/dist/index.cjs +24 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +242 -6
- package/dist/index.d.ts +242 -6
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -805,7 +805,7 @@ var HeyApiRegistry = class {
|
|
|
805
805
|
get(key) {
|
|
806
806
|
const instance = this.instances.get(key ?? this.defaultKey);
|
|
807
807
|
if (!instance) {
|
|
808
|
-
throw new Error(`No SDK client found. Create one with "new
|
|
808
|
+
throw new Error(`No SDK client found. Create one with "new PostPeer()" to fix this error.`);
|
|
809
809
|
}
|
|
810
810
|
return instance;
|
|
811
811
|
}
|
|
@@ -1196,6 +1196,22 @@ var Scheduled = class extends HeyApiClient {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
});
|
|
1198
1198
|
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Edit a scheduled post (content, media, platforms, time)
|
|
1201
|
+
*
|
|
1202
|
+
* Replaces the editable fields of a scheduled post: text content, media attachments, target platforms + platform-specific data, and optionally the scheduled time/timezone. Re-validates each platform and reconciles the credit difference. Only works while the post is still scheduled.
|
|
1203
|
+
*/
|
|
1204
|
+
edit(options) {
|
|
1205
|
+
return (options.client ?? this.client).put({
|
|
1206
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1207
|
+
url: "/v1/posts/scheduled/{postId}",
|
|
1208
|
+
...options,
|
|
1209
|
+
headers: {
|
|
1210
|
+
"Content-Type": "application/json",
|
|
1211
|
+
...options.headers
|
|
1212
|
+
}
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1199
1215
|
};
|
|
1200
1216
|
var Posts = class extends HeyApiClient {
|
|
1201
1217
|
static {
|
|
@@ -1374,14 +1390,14 @@ var Ai = class extends HeyApiClient {
|
|
|
1374
1390
|
});
|
|
1375
1391
|
}
|
|
1376
1392
|
};
|
|
1377
|
-
var
|
|
1393
|
+
var PostPeer = class _PostPeer extends HeyApiClient {
|
|
1378
1394
|
static {
|
|
1379
|
-
__name(this, "
|
|
1395
|
+
__name(this, "PostPeer");
|
|
1380
1396
|
}
|
|
1381
1397
|
static __registry = new HeyApiRegistry();
|
|
1382
1398
|
constructor(args) {
|
|
1383
1399
|
super(args);
|
|
1384
|
-
|
|
1400
|
+
_PostPeer.__registry.set(this, args?.key);
|
|
1385
1401
|
}
|
|
1386
1402
|
_health;
|
|
1387
1403
|
get health() {
|
|
@@ -1576,7 +1592,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
|
|
|
1576
1592
|
}, "createAPIError");
|
|
1577
1593
|
|
|
1578
1594
|
// src/version.ts
|
|
1579
|
-
var VERSION = "0.8.
|
|
1595
|
+
var VERSION = "0.8.2";
|
|
1580
1596
|
|
|
1581
1597
|
// src/client.ts
|
|
1582
1598
|
var DEFAULT_BASE_URL = "https://api.postpeer.dev";
|
|
@@ -1629,7 +1645,7 @@ var createPostPeerFetch = /* @__PURE__ */ __name(({
|
|
|
1629
1645
|
throw new APIConnectionError("Connection failed.");
|
|
1630
1646
|
};
|
|
1631
1647
|
}, "createPostPeerFetch");
|
|
1632
|
-
var
|
|
1648
|
+
var PostPeer2 = class _PostPeer extends PostPeer {
|
|
1633
1649
|
static {
|
|
1634
1650
|
__name(this, "PostPeer");
|
|
1635
1651
|
}
|
|
@@ -1685,6 +1701,6 @@ var PostPeer = class _PostPeer extends PostPeerApi {
|
|
|
1685
1701
|
}
|
|
1686
1702
|
};
|
|
1687
1703
|
|
|
1688
|
-
export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PermissionDeniedError, PostPeer, PostPeerError, RateLimitError, UnprocessableEntityError, VERSION,
|
|
1704
|
+
export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PermissionDeniedError, PostPeer2 as PostPeer, PostPeerError, RateLimitError, UnprocessableEntityError, VERSION, PostPeer2 as default };
|
|
1689
1705
|
//# sourceMappingURL=index.js.map
|
|
1690
1706
|
//# sourceMappingURL=index.js.map
|