@postpeer/node 0.8.0 → 0.8.1

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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.1
4
+
5
+ - Standardized the public SDK class name as `PostPeer` throughout generated code and documentation.
6
+
3
7
  ## 0.8.0
4
8
 
5
9
  - Rebuilt the SDK with Hey API from the PostPeer OpenAPI specification.
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2026 Postpeer
189
+ Copyright 2026 PostPeer
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -15,9 +15,9 @@ Node.js 20 or newer is required.
15
15
  ```ts
16
16
  import PostPeer from '@postpeer/node';
17
17
 
18
- const postPeer = new PostPeer(); // Uses POSTPEER_API_KEY
18
+ const client = new PostPeer(); // Uses POSTPEER_API_KEY
19
19
 
20
- const { data: post } = await postPeer.posts.create({
20
+ const { data: post } = await client.posts.create({
21
21
  body: {
22
22
  content: 'Hello from PostPeer!',
23
23
  platforms: [{ platform: 'twitter', accountId: 'integration-id' }],
@@ -31,7 +31,7 @@ console.log(post);
31
31
  You can also pass the key directly:
32
32
 
33
33
  ```ts
34
- const postPeer = new PostPeer({
34
+ const client = new PostPeer({
35
35
  apiKey: 'your-access-key',
36
36
  });
37
37
  ```
@@ -39,7 +39,7 @@ const postPeer = new PostPeer({
39
39
  ## Configuration
40
40
 
41
41
  ```ts
42
- const postPeer = new PostPeer({
42
+ const client = new PostPeer({
43
43
  apiKey: 'your-access-key',
44
44
  baseURL: 'https://api.postpeer.dev',
45
45
  timeout: 60_000,
@@ -56,32 +56,32 @@ Every `PostPeer` instance owns an isolated HTTP client, so separate API keys and
56
56
  The SDK follows the API's resource structure:
57
57
 
58
58
  ```ts
59
- postPeer.health.check();
60
- postPeer.health.verifyAccessKey();
61
-
62
- postPeer.posts.create({ body });
63
- postPeer.posts.list({ query });
64
- postPeer.posts.get({ path: { postId } });
65
- postPeer.posts.delete({ path: { postId } });
66
- postPeer.posts.scheduled.list();
67
- postPeer.posts.scheduled.cancel({ path: { postId } });
68
- postPeer.posts.scheduled.reschedule({ path: { postId }, body });
69
-
70
- postPeer.connect.getOAuthUrl({ path: { platform }, query });
71
- postPeer.connect.integrations.list();
72
- postPeer.connect.integrations.disconnect({ path: { id } });
73
-
74
- postPeer.profiles.list();
75
- postPeer.apps.list();
76
- postPeer.notifications.list();
77
- postPeer.platforms.list();
78
- postPeer.media.upload({ body });
79
- postPeer.analytics.get({ query });
80
- postPeer.usage.get();
81
- postPeer.pinterest.getBoards({ query });
82
- postPeer.tiktok.getCreatorInfo({ query });
83
- postPeer.ai.write({ body });
84
- postPeer.ai.generateImage({ body });
59
+ client.health.check();
60
+ client.health.verifyAccessKey();
61
+
62
+ client.posts.create({ body });
63
+ client.posts.list({ query });
64
+ client.posts.get({ path: { postId } });
65
+ client.posts.delete({ path: { postId } });
66
+ client.posts.scheduled.list();
67
+ client.posts.scheduled.cancel({ path: { postId } });
68
+ client.posts.scheduled.reschedule({ path: { postId }, body });
69
+
70
+ client.connect.getOAuthUrl({ path: { platform }, query });
71
+ client.connect.integrations.list();
72
+ client.connect.integrations.disconnect({ path: { id } });
73
+
74
+ client.profiles.list();
75
+ client.apps.list();
76
+ client.notifications.list();
77
+ client.platforms.list();
78
+ client.media.upload({ body });
79
+ client.analytics.get({ query });
80
+ client.usage.get();
81
+ client.pinterest.getBoards({ query });
82
+ client.tiktok.getCreatorInfo({ query });
83
+ client.ai.write({ body });
84
+ client.ai.generateImage({ body });
85
85
  ```
86
86
 
87
87
  Request parameters are grouped under `body`, `path`, `query`, and `headers`. Responses include `data`, `request`, and `response`, giving you access to the parsed result and the native Fetch objects.
@@ -91,8 +91,10 @@ Request parameters are grouped under `body`, `path`, `query`, and `headers`. Res
91
91
  ```ts
92
92
  import PostPeer, { NotFoundError, RateLimitError } from '@postpeer/node';
93
93
 
94
+ const client = new PostPeer();
95
+
94
96
  try {
95
- await postPeer.posts.get({ path: { postId: 'missing' } });
97
+ await client.posts.get({ path: { postId: 'missing' } });
96
98
  } catch (error) {
97
99
  if (error instanceof NotFoundError) {
98
100
  console.error(error.status, error.requestId, error.message);
@@ -114,7 +116,9 @@ pnpm generate
114
116
  pnpm check
115
117
  ```
116
118
 
117
- Commit `openapi.json` and `src/generated` together. This updates the code but does not publish a package. Package versions change only when a release PR is deliberately merged.
119
+ Commit `openapi.json` and `src/generated` together. This updates the code but does not publish a package.
120
+
121
+ For a release, update `package.json`, `src/version.ts`, and `CHANGELOG.md`, run `pnpm check`, then publish with `npm publish --access public`.
118
122
 
119
123
  Generated files under `src/generated` must not be edited by hand.
120
124
 
package/dist/index.cjs CHANGED
@@ -809,7 +809,7 @@ var HeyApiRegistry = class {
809
809
  get(key) {
810
810
  const instance = this.instances.get(key ?? this.defaultKey);
811
811
  if (!instance) {
812
- throw new Error(`No SDK client found. Create one with "new PostPeerApi()" to fix this error.`);
812
+ throw new Error(`No SDK client found. Create one with "new PostPeer()" to fix this error.`);
813
813
  }
814
814
  return instance;
815
815
  }
@@ -1378,14 +1378,14 @@ var Ai = class extends HeyApiClient {
1378
1378
  });
1379
1379
  }
1380
1380
  };
1381
- var PostPeerApi = class _PostPeerApi extends HeyApiClient {
1381
+ var PostPeer = class _PostPeer extends HeyApiClient {
1382
1382
  static {
1383
- __name(this, "PostPeerApi");
1383
+ __name(this, "PostPeer");
1384
1384
  }
1385
1385
  static __registry = new HeyApiRegistry();
1386
1386
  constructor(args) {
1387
1387
  super(args);
1388
- _PostPeerApi.__registry.set(this, args?.key);
1388
+ _PostPeer.__registry.set(this, args?.key);
1389
1389
  }
1390
1390
  _health;
1391
1391
  get health() {
@@ -1580,7 +1580,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
1580
1580
  }, "createAPIError");
1581
1581
 
1582
1582
  // src/version.ts
1583
- var VERSION = "0.8.0";
1583
+ var VERSION = "0.8.1";
1584
1584
 
1585
1585
  // src/client.ts
1586
1586
  var DEFAULT_BASE_URL = "https://api.postpeer.dev";
@@ -1633,7 +1633,7 @@ var createPostPeerFetch = /* @__PURE__ */ __name(({
1633
1633
  throw new APIConnectionError("Connection failed.");
1634
1634
  };
1635
1635
  }, "createPostPeerFetch");
1636
- var PostPeer = class _PostPeer extends PostPeerApi {
1636
+ var PostPeer2 = class _PostPeer extends PostPeer {
1637
1637
  static {
1638
1638
  __name(this, "PostPeer");
1639
1639
  }
@@ -1699,11 +1699,11 @@ exports.ConflictError = ConflictError;
1699
1699
  exports.InternalServerError = InternalServerError;
1700
1700
  exports.NotFoundError = NotFoundError;
1701
1701
  exports.PermissionDeniedError = PermissionDeniedError;
1702
- exports.PostPeer = PostPeer;
1702
+ exports.PostPeer = PostPeer2;
1703
1703
  exports.PostPeerError = PostPeerError;
1704
1704
  exports.RateLimitError = RateLimitError;
1705
1705
  exports.UnprocessableEntityError = UnprocessableEntityError;
1706
1706
  exports.VERSION = VERSION;
1707
- exports.default = PostPeer;
1707
+ exports.default = PostPeer2;
1708
1708
  //# sourceMappingURL=index.cjs.map
1709
1709
  //# sourceMappingURL=index.cjs.map