@postpeer/node 0.8.2 → 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 +5 -0
- package/README.md +3 -0
- package/dist/index.cjs +46 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +264 -4
- package/dist/index.d.ts +264 -4
- package/dist/index.js +46 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -69,7 +69,10 @@ client.posts.scheduled.cancel({ path: { postId } });
|
|
|
69
69
|
client.posts.scheduled.reschedule({ path: { postId }, body });
|
|
70
70
|
|
|
71
71
|
client.connect.getOAuthUrl({ path: { platform }, query });
|
|
72
|
+
client.connect.facebook.getSelection({ path: { token } });
|
|
73
|
+
client.connect.facebook.submitSelection({ path: { token }, body });
|
|
72
74
|
client.connect.integrations.list();
|
|
75
|
+
client.connect.integrations.get({ path: { id } });
|
|
73
76
|
client.connect.integrations.disconnect({ path: { id } });
|
|
74
77
|
|
|
75
78
|
client.profiles.list();
|
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 });
|
|
@@ -1596,7 +1640,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
|
|
|
1596
1640
|
}, "createAPIError");
|
|
1597
1641
|
|
|
1598
1642
|
// src/version.ts
|
|
1599
|
-
var VERSION = "0.8.
|
|
1643
|
+
var VERSION = "0.8.3";
|
|
1600
1644
|
|
|
1601
1645
|
// src/client.ts
|
|
1602
1646
|
var DEFAULT_BASE_URL = "https://api.postpeer.dev";
|