@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/dist/index.js
CHANGED
|
@@ -862,6 +862,34 @@ var Linkedin = class extends HeyApiClient {
|
|
|
862
862
|
});
|
|
863
863
|
}
|
|
864
864
|
};
|
|
865
|
+
var Facebook = class extends HeyApiClient {
|
|
866
|
+
static {
|
|
867
|
+
__name(this, "Facebook");
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Get pending Facebook Page choices
|
|
871
|
+
*
|
|
872
|
+
* 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.
|
|
873
|
+
*/
|
|
874
|
+
getSelection(options) {
|
|
875
|
+
return (options.client ?? this.client).get({ url: "/v1/connect/facebook/selection/{token}", ...options });
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Save selected Facebook Pages
|
|
879
|
+
*
|
|
880
|
+
* Saves only the selected Facebook Pages as integrations, then invalidates the one-time selection token.
|
|
881
|
+
*/
|
|
882
|
+
submitSelection(options) {
|
|
883
|
+
return (options.client ?? this.client).post({
|
|
884
|
+
url: "/v1/connect/facebook/selection/{token}",
|
|
885
|
+
...options,
|
|
886
|
+
headers: {
|
|
887
|
+
"Content-Type": "application/json",
|
|
888
|
+
...options.headers
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
};
|
|
865
893
|
var Integrations = class extends HeyApiClient {
|
|
866
894
|
static {
|
|
867
895
|
__name(this, "Integrations");
|
|
@@ -886,6 +914,18 @@ var Integrations = class extends HeyApiClient {
|
|
|
886
914
|
...options
|
|
887
915
|
});
|
|
888
916
|
}
|
|
917
|
+
/**
|
|
918
|
+
* Get integration details
|
|
919
|
+
*
|
|
920
|
+
* Returns one integration, including its recorded OAuth scopes and token expiry metadata. OAuth tokens are never returned.
|
|
921
|
+
*/
|
|
922
|
+
get(options) {
|
|
923
|
+
return (options.client ?? this.client).get({
|
|
924
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
925
|
+
url: "/v1/connect/integrations/{id}",
|
|
926
|
+
...options
|
|
927
|
+
});
|
|
928
|
+
}
|
|
889
929
|
};
|
|
890
930
|
var Connect = class extends HeyApiClient {
|
|
891
931
|
static {
|
|
@@ -894,7 +934,7 @@ var Connect = class extends HeyApiClient {
|
|
|
894
934
|
/**
|
|
895
935
|
* Get OAuth URL for a platform
|
|
896
936
|
*
|
|
897
|
-
* 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
|
|
937
|
+
* 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.
|
|
898
938
|
*/
|
|
899
939
|
getOAuthUrl(options) {
|
|
900
940
|
return (options.client ?? this.client).get({
|
|
@@ -923,6 +963,10 @@ var Connect = class extends HeyApiClient {
|
|
|
923
963
|
get linkedin() {
|
|
924
964
|
return this._linkedin ??= new Linkedin({ client: this.client });
|
|
925
965
|
}
|
|
966
|
+
_facebook;
|
|
967
|
+
get facebook() {
|
|
968
|
+
return this._facebook ??= new Facebook({ client: this.client });
|
|
969
|
+
}
|
|
926
970
|
_integrations;
|
|
927
971
|
get integrations() {
|
|
928
972
|
return this._integrations ??= new Integrations({ client: this.client });
|
|
@@ -1196,6 +1240,22 @@ var Scheduled = class extends HeyApiClient {
|
|
|
1196
1240
|
}
|
|
1197
1241
|
});
|
|
1198
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Edit a scheduled post (content, media, platforms, time)
|
|
1245
|
+
*
|
|
1246
|
+
* 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.
|
|
1247
|
+
*/
|
|
1248
|
+
edit(options) {
|
|
1249
|
+
return (options.client ?? this.client).put({
|
|
1250
|
+
security: [{ name: "x-access-key", type: "apiKey" }],
|
|
1251
|
+
url: "/v1/posts/scheduled/{postId}",
|
|
1252
|
+
...options,
|
|
1253
|
+
headers: {
|
|
1254
|
+
"Content-Type": "application/json",
|
|
1255
|
+
...options.headers
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1199
1259
|
};
|
|
1200
1260
|
var Posts = class extends HeyApiClient {
|
|
1201
1261
|
static {
|
|
@@ -1576,7 +1636,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
|
|
|
1576
1636
|
}, "createAPIError");
|
|
1577
1637
|
|
|
1578
1638
|
// src/version.ts
|
|
1579
|
-
var VERSION = "0.8.
|
|
1639
|
+
var VERSION = "0.8.3";
|
|
1580
1640
|
|
|
1581
1641
|
// src/client.ts
|
|
1582
1642
|
var DEFAULT_BASE_URL = "https://api.postpeer.dev";
|