@postpeer/node 0.8.1 → 0.8.3
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 +10 -0
- package/README.md +18 -0
- package/dist/index.cjs +62 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +501 -5
- package/dist/index.d.ts +501 -5
- package/dist/index.js +62 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.3
|
|
4
|
+
|
|
5
|
+
- Added Facebook Page selection methods for multi-page OAuth connections.
|
|
6
|
+
- Added fetching details for a single connected integration.
|
|
7
|
+
|
|
8
|
+
## 0.8.2
|
|
9
|
+
|
|
10
|
+
- Added scheduled-post editing through `client.posts.scheduled.edit()`.
|
|
11
|
+
- Added LinkedIn company-page mentions and Instagram Story publishing options.
|
|
12
|
+
|
|
3
13
|
## 0.8.1
|
|
4
14
|
|
|
5
15
|
- Standardized the public SDK class name as `PostPeer` throughout generated code and documentation.
|
package/README.md
CHANGED
|
@@ -64,11 +64,15 @@ client.posts.list({ query });
|
|
|
64
64
|
client.posts.get({ path: { postId } });
|
|
65
65
|
client.posts.delete({ path: { postId } });
|
|
66
66
|
client.posts.scheduled.list();
|
|
67
|
+
client.posts.scheduled.edit({ path: { postId }, body });
|
|
67
68
|
client.posts.scheduled.cancel({ path: { postId } });
|
|
68
69
|
client.posts.scheduled.reschedule({ path: { postId }, body });
|
|
69
70
|
|
|
70
71
|
client.connect.getOAuthUrl({ path: { platform }, query });
|
|
72
|
+
client.connect.facebook.getSelection({ path: { token } });
|
|
73
|
+
client.connect.facebook.submitSelection({ path: { token }, body });
|
|
71
74
|
client.connect.integrations.list();
|
|
75
|
+
client.connect.integrations.get({ path: { id } });
|
|
72
76
|
client.connect.integrations.disconnect({ path: { id } });
|
|
73
77
|
|
|
74
78
|
client.profiles.list();
|
|
@@ -86,6 +90,20 @@ client.ai.generateImage({ body });
|
|
|
86
90
|
|
|
87
91
|
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.
|
|
88
92
|
|
|
93
|
+
### Instagram Stories
|
|
94
|
+
|
|
95
|
+
The generated `InstagramConfigurations` type now supports Story publishing:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
import type { InstagramConfigurations } from '@postpeer/node';
|
|
99
|
+
|
|
100
|
+
const platformSpecificData: InstagramConfigurations = {
|
|
101
|
+
contentType: 'story',
|
|
102
|
+
};
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Pass `platformSpecificData` on an Instagram platform entry when creating or editing a post. Omit `contentType` to keep the existing behavior: images publish to Feed and videos publish as Reels.
|
|
106
|
+
|
|
89
107
|
## Error handling
|
|
90
108
|
|
|
91
109
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -866,6 +866,34 @@ var Linkedin = class extends HeyApiClient {
|
|
|
866
866
|
});
|
|
867
867
|
}
|
|
868
868
|
};
|
|
869
|
+
var Facebook = class extends HeyApiClient {
|
|
870
|
+
static {
|
|
871
|
+
__name(this, "Facebook");
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Get pending Facebook Page choices
|
|
875
|
+
*
|
|
876
|
+
* Returns the Facebook Pages available after OAuth when the user must choose which Pages to connect. The selection token is short-lived and one-time.
|
|
877
|
+
*/
|
|
878
|
+
getSelection(options) {
|
|
879
|
+
return (options.client ?? this.client).get({ url: "/v1/connect/facebook/selection/{token}", ...options });
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Save selected Facebook Pages
|
|
883
|
+
*
|
|
884
|
+
* Saves only the selected Facebook Pages as integrations, then invalidates the one-time selection token.
|
|
885
|
+
*/
|
|
886
|
+
submitSelection(options) {
|
|
887
|
+
return (options.client ?? this.client).post({
|
|
888
|
+
url: "/v1/connect/facebook/selection/{token}",
|
|
889
|
+
...options,
|
|
890
|
+
headers: {
|
|
891
|
+
"Content-Type": "application/json",
|
|
892
|
+
...options.headers
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
};
|
|
869
897
|
var Integrations = class extends HeyApiClient {
|
|
870
898
|
static {
|
|
871
899
|
__name(this, "Integrations");
|
|
@@ -890,6 +918,18 @@ var Integrations = class extends HeyApiClient {
|
|
|
890
918
|
...options
|
|
891
919
|
});
|
|
892
920
|
}
|
|
921
|
+
/**
|
|
922
|
+
* Get integration details
|
|
923
|
+
*
|
|
924
|
+
* Returns one integration, including its recorded OAuth scopes and token expiry metadata. OAuth tokens are never returned.
|
|
925
|
+
*/
|
|
926
|
+
get(options) {
|
|
927
|
+
return (options.client ?? this.client).get({
|
|
928
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
929
|
+
url: "/v1/connect/integrations/{id}",
|
|
930
|
+
...options
|
|
931
|
+
});
|
|
932
|
+
}
|
|
893
933
|
};
|
|
894
934
|
var Connect = class extends HeyApiClient {
|
|
895
935
|
static {
|
|
@@ -898,7 +938,7 @@ var Connect = class extends HeyApiClient {
|
|
|
898
938
|
/**
|
|
899
939
|
* Get OAuth URL for a platform
|
|
900
940
|
*
|
|
901
|
-
* Initiates an OAuth connection flow. By default, PostPeer hosts any required account selection UI and then returns the user to redirectUri. For LinkedIn custom account-selection UI, pass headless=true; if selection is required, the callback redirects to redirectUri with status=selection_required, platform
|
|
941
|
+
* Initiates an OAuth connection flow. By default, PostPeer hosts any required account selection UI and then returns the user to redirectUri. For LinkedIn or Facebook custom account-selection UI, pass headless=true; if selection is required, the callback redirects to redirectUri with status=selection_required, platform, and selectionToken.
|
|
902
942
|
*/
|
|
903
943
|
getOAuthUrl(options) {
|
|
904
944
|
return (options.client ?? this.client).get({
|
|
@@ -927,6 +967,10 @@ var Connect = class extends HeyApiClient {
|
|
|
927
967
|
get linkedin() {
|
|
928
968
|
return this._linkedin ??= new Linkedin({ client: this.client });
|
|
929
969
|
}
|
|
970
|
+
_facebook;
|
|
971
|
+
get facebook() {
|
|
972
|
+
return this._facebook ??= new Facebook({ client: this.client });
|
|
973
|
+
}
|
|
930
974
|
_integrations;
|
|
931
975
|
get integrations() {
|
|
932
976
|
return this._integrations ??= new Integrations({ client: this.client });
|
|
@@ -1200,6 +1244,22 @@ var Scheduled = class extends HeyApiClient {
|
|
|
1200
1244
|
}
|
|
1201
1245
|
});
|
|
1202
1246
|
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Edit a scheduled post (content, media, platforms, time)
|
|
1249
|
+
*
|
|
1250
|
+
* 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.
|
|
1251
|
+
*/
|
|
1252
|
+
edit(options) {
|
|
1253
|
+
return (options.client ?? this.client).put({
|
|
1254
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1255
|
+
url: "/v1/posts/scheduled/{postId}",
|
|
1256
|
+
...options,
|
|
1257
|
+
headers: {
|
|
1258
|
+
"Content-Type": "application/json",
|
|
1259
|
+
...options.headers
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1203
1263
|
};
|
|
1204
1264
|
var Posts = class extends HeyApiClient {
|
|
1205
1265
|
static {
|
|
@@ -1580,7 +1640,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
|
|
|
1580
1640
|
}, "createAPIError");
|
|
1581
1641
|
|
|
1582
1642
|
// src/version.ts
|
|
1583
|
-
var VERSION = "0.8.
|
|
1643
|
+
var VERSION = "0.8.3";
|
|
1584
1644
|
|
|
1585
1645
|
// src/client.ts
|
|
1586
1646
|
var DEFAULT_BASE_URL = "https://api.postpeer.dev";
|