@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/dist/index.d.ts CHANGED
@@ -365,6 +365,10 @@ type TwitterConfigurations = {
365
365
  thumbnail?: string;
366
366
  }>;
367
367
  }>;
368
+ /**
369
+ * Opt in to long posts (over 280 characters). Skips PostPeer's 280-character pre-check so X can accept up to 25,000 characters for eligible Premium / Premium+ accounts. If the connected account is not eligible, X rejects the post and the error is surfaced back. No extra API cost.
370
+ */
371
+ longPost?: boolean;
368
372
  /**
369
373
  * Cannot be combined with media or threadItems.
370
374
  */
@@ -955,6 +959,133 @@ type PostV1ConnectLinkedinSelectionByTokenResponses = {
955
959
  };
956
960
  };
957
961
  type PostV1ConnectLinkedinSelectionByTokenResponse = PostV1ConnectLinkedinSelectionByTokenResponses[keyof PostV1ConnectLinkedinSelectionByTokenResponses];
962
+ type GetV1ConnectFacebookSelectionByTokenData = {
963
+ body?: never;
964
+ path: {
965
+ token: string;
966
+ };
967
+ query?: never;
968
+ url: '/v1/connect/facebook/selection/{token}';
969
+ };
970
+ type GetV1ConnectFacebookSelectionByTokenErrors = {
971
+ /**
972
+ * Default Response
973
+ */
974
+ 404: {
975
+ error: string;
976
+ };
977
+ };
978
+ type GetV1ConnectFacebookSelectionByTokenError = GetV1ConnectFacebookSelectionByTokenErrors[keyof GetV1ConnectFacebookSelectionByTokenErrors];
979
+ type GetV1ConnectFacebookSelectionByTokenResponses = {
980
+ /**
981
+ * Default Response
982
+ */
983
+ 200: {
984
+ success: boolean;
985
+ platform: 'facebook';
986
+ expiresInSeconds: number;
987
+ accounts: Array<{
988
+ id: string;
989
+ type: 'page';
990
+ platformUserId: string;
991
+ displayName: string | null;
992
+ username: string | null;
993
+ imageUrl: string | null;
994
+ }>;
995
+ };
996
+ };
997
+ type GetV1ConnectFacebookSelectionByTokenResponse = GetV1ConnectFacebookSelectionByTokenResponses[keyof GetV1ConnectFacebookSelectionByTokenResponses];
998
+ type PostV1ConnectFacebookSelectionByTokenData = {
999
+ body: {
1000
+ selectedAccountIds: Array<string>;
1001
+ };
1002
+ path: {
1003
+ token: string;
1004
+ };
1005
+ query?: never;
1006
+ url: '/v1/connect/facebook/selection/{token}';
1007
+ };
1008
+ type PostV1ConnectFacebookSelectionByTokenErrors = {
1009
+ /**
1010
+ * Default Response
1011
+ */
1012
+ 400: {
1013
+ error: string;
1014
+ };
1015
+ /**
1016
+ * Default Response
1017
+ */
1018
+ 404: {
1019
+ error: string;
1020
+ };
1021
+ };
1022
+ type PostV1ConnectFacebookSelectionByTokenError = PostV1ConnectFacebookSelectionByTokenErrors[keyof PostV1ConnectFacebookSelectionByTokenErrors];
1023
+ type PostV1ConnectFacebookSelectionByTokenResponses = {
1024
+ /**
1025
+ * Default Response
1026
+ */
1027
+ 200: {
1028
+ success: boolean;
1029
+ platform: 'facebook';
1030
+ message: string;
1031
+ redirectUri?: string;
1032
+ integrations: Array<{
1033
+ /**
1034
+ * Use this as accountId when creating posts
1035
+ */
1036
+ id: string;
1037
+ platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
1038
+ /**
1039
+ * The user ID on the platform, or null if not yet retrieved
1040
+ */
1041
+ platformUserId: string | null;
1042
+ /**
1043
+ * The public username or handle, including @ for handle-based platforms
1044
+ */
1045
+ username: string | null;
1046
+ /**
1047
+ * Human-readable display name of the connected account
1048
+ */
1049
+ displayName: string | null;
1050
+ /**
1051
+ * Public profile/page URL for the connected account, when it can be derived
1052
+ */
1053
+ profileUrl: string | null;
1054
+ /**
1055
+ * Profile image URL for the connected account, or null if unavailable
1056
+ */
1057
+ imageUrl: string | null;
1058
+ /**
1059
+ * Provider-specific public metadata for this connected account.
1060
+ */
1061
+ platformMetadata?: {
1062
+ [key: string]: unknown;
1063
+ };
1064
+ /**
1065
+ * Profile this integration belongs to, or null if it was connected without a profile
1066
+ */
1067
+ profileId: string | null;
1068
+ /**
1069
+ * The OAuth app (customer's own OAuth app) this integration was connected under, or null if postpeer's system app was used.
1070
+ */
1071
+ appId: string | null;
1072
+ /**
1073
+ * The OAuth app metadata for BYOK integrations, or null when postpeer system app was used.
1074
+ */
1075
+ app: {
1076
+ id?: string;
1077
+ name?: string;
1078
+ imageUrl?: string | null;
1079
+ } | null;
1080
+ /**
1081
+ * True when this integration was connected under the customer's own OAuth app (Bring Your Own Keys), i.e. appId is set. False when postpeer's system app is used.
1082
+ */
1083
+ byok: boolean;
1084
+ createdAt: string;
1085
+ }>;
1086
+ };
1087
+ };
1088
+ type PostV1ConnectFacebookSelectionByTokenResponse = PostV1ConnectFacebookSelectionByTokenResponses[keyof PostV1ConnectFacebookSelectionByTokenResponses];
958
1089
  type GetV1ConnectByPlatformData = {
959
1090
  body?: never;
960
1091
  path: {
@@ -1155,7 +1286,7 @@ type DeleteV1ConnectIntegrationsByIdData = {
1155
1286
  body?: never;
1156
1287
  path: {
1157
1288
  /**
1158
- * Integration ID to disconnect
1289
+ * Integration ID
1159
1290
  */
1160
1291
  id: string;
1161
1292
  };
@@ -1181,6 +1312,113 @@ type DeleteV1ConnectIntegrationsByIdResponses = {
1181
1312
  };
1182
1313
  };
1183
1314
  type DeleteV1ConnectIntegrationsByIdResponse = DeleteV1ConnectIntegrationsByIdResponses[keyof DeleteV1ConnectIntegrationsByIdResponses];
1315
+ type GetV1ConnectIntegrationsByIdData = {
1316
+ body?: never;
1317
+ path: {
1318
+ /**
1319
+ * Integration ID
1320
+ */
1321
+ id: string;
1322
+ };
1323
+ query?: never;
1324
+ url: '/v1/connect/integrations/{id}';
1325
+ };
1326
+ type GetV1ConnectIntegrationsByIdErrors = {
1327
+ /**
1328
+ * Default Response
1329
+ */
1330
+ 404: {
1331
+ error: string;
1332
+ };
1333
+ };
1334
+ type GetV1ConnectIntegrationsByIdError = GetV1ConnectIntegrationsByIdErrors[keyof GetV1ConnectIntegrationsByIdErrors];
1335
+ type GetV1ConnectIntegrationsByIdResponses = {
1336
+ /**
1337
+ * Default Response
1338
+ */
1339
+ 200: {
1340
+ success: boolean;
1341
+ integration: {
1342
+ /**
1343
+ * Use this as accountId when creating posts
1344
+ */
1345
+ id: string;
1346
+ platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
1347
+ /**
1348
+ * The user ID on the platform, or null if not yet retrieved
1349
+ */
1350
+ platformUserId: string | null;
1351
+ /**
1352
+ * The public username or handle, including @ for handle-based platforms
1353
+ */
1354
+ username: string | null;
1355
+ /**
1356
+ * Human-readable display name of the connected account
1357
+ */
1358
+ displayName: string | null;
1359
+ /**
1360
+ * Public profile/page URL for the connected account, when it can be derived
1361
+ */
1362
+ profileUrl: string | null;
1363
+ /**
1364
+ * Profile image URL for the connected account, or null if unavailable
1365
+ */
1366
+ imageUrl: string | null;
1367
+ /**
1368
+ * Provider-specific public metadata for this connected account.
1369
+ */
1370
+ platformMetadata?: {
1371
+ [key: string]: unknown;
1372
+ };
1373
+ /**
1374
+ * Profile this integration belongs to, or null if it was connected without a profile
1375
+ */
1376
+ profileId: string | null;
1377
+ /**
1378
+ * The OAuth app (customer's own OAuth app) this integration was connected under, or null if postpeer's system app was used.
1379
+ */
1380
+ appId: string | null;
1381
+ /**
1382
+ * The OAuth app metadata for BYOK integrations, or null when postpeer system app was used.
1383
+ */
1384
+ app: {
1385
+ id?: string;
1386
+ name?: string;
1387
+ imageUrl?: string | null;
1388
+ } | null;
1389
+ /**
1390
+ * True when this integration was connected under the customer's own OAuth app (Bring Your Own Keys), i.e. appId is set. False when postpeer's system app is used.
1391
+ */
1392
+ byok: boolean;
1393
+ createdAt: string;
1394
+ } & {
1395
+ /**
1396
+ * OAuth scopes recorded when this integration was connected
1397
+ */
1398
+ scopes: Array<string>;
1399
+ /**
1400
+ * When the current access token expires, or null when the provider does not report an expiry
1401
+ */
1402
+ accessTokenExpiresAt: string | null;
1403
+ /**
1404
+ * When the refresh token expires, or null when the provider does not report an expiry
1405
+ */
1406
+ refreshTokenExpiresAt: string | null;
1407
+ tokenStatus: {
1408
+ /**
1409
+ * Whether recorded expiry metadata indicates the integration can authenticate. Provider revocation is detected when the integration is used.
1410
+ */
1411
+ valid: boolean;
1412
+ /**
1413
+ * Whether PostPeer automatically refreshes this platform token when needed.
1414
+ */
1415
+ autoRefreshes: boolean;
1416
+ };
1417
+ updatedAt: string;
1418
+ };
1419
+ };
1420
+ };
1421
+ type GetV1ConnectIntegrationsByIdResponse = GetV1ConnectIntegrationsByIdResponses[keyof GetV1ConnectIntegrationsByIdResponses];
1184
1422
  type GetV1ProfilesData = {
1185
1423
  body?: never;
1186
1424
  path?: never;
@@ -3404,6 +3642,20 @@ declare class Linkedin extends HeyApiClient {
3404
3642
  */
3405
3643
  submitSelection<ThrowOnError extends boolean = false>(options: Options<PostV1ConnectLinkedinSelectionByTokenData, ThrowOnError>): RequestResult<PostV1ConnectLinkedinSelectionByTokenResponses, PostV1ConnectLinkedinSelectionByTokenErrors, ThrowOnError>;
3406
3644
  }
3645
+ declare class Facebook extends HeyApiClient {
3646
+ /**
3647
+ * Get pending Facebook Page choices
3648
+ *
3649
+ * 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.
3650
+ */
3651
+ getSelection<ThrowOnError extends boolean = false>(options: Options<GetV1ConnectFacebookSelectionByTokenData, ThrowOnError>): RequestResult<GetV1ConnectFacebookSelectionByTokenResponses, GetV1ConnectFacebookSelectionByTokenErrors, ThrowOnError>;
3652
+ /**
3653
+ * Save selected Facebook Pages
3654
+ *
3655
+ * Saves only the selected Facebook Pages as integrations, then invalidates the one-time selection token.
3656
+ */
3657
+ submitSelection<ThrowOnError extends boolean = false>(options: Options<PostV1ConnectFacebookSelectionByTokenData, ThrowOnError>): RequestResult<PostV1ConnectFacebookSelectionByTokenResponses, PostV1ConnectFacebookSelectionByTokenErrors, ThrowOnError>;
3658
+ }
3407
3659
  declare class Integrations extends HeyApiClient {
3408
3660
  /**
3409
3661
  * List integrations connected to this project
@@ -3413,12 +3665,18 @@ declare class Integrations extends HeyApiClient {
3413
3665
  * Disconnect a platform integration
3414
3666
  */
3415
3667
  disconnect<ThrowOnError extends boolean = false>(options: Options<DeleteV1ConnectIntegrationsByIdData, ThrowOnError>): RequestResult<DeleteV1ConnectIntegrationsByIdResponses, DeleteV1ConnectIntegrationsByIdErrors, ThrowOnError>;
3668
+ /**
3669
+ * Get integration details
3670
+ *
3671
+ * Returns one integration, including its recorded OAuth scopes and token expiry metadata. OAuth tokens are never returned.
3672
+ */
3673
+ get<ThrowOnError extends boolean = false>(options: Options<GetV1ConnectIntegrationsByIdData, ThrowOnError>): RequestResult<GetV1ConnectIntegrationsByIdResponses, GetV1ConnectIntegrationsByIdErrors, ThrowOnError>;
3416
3674
  }
3417
3675
  declare class Connect extends HeyApiClient {
3418
3676
  /**
3419
3677
  * Get OAuth URL for a platform
3420
3678
  *
3421
- * 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=linkedin, and selectionToken.
3679
+ * 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.
3422
3680
  */
3423
3681
  getOAuthUrl<ThrowOnError extends boolean = false>(options: Options<GetV1ConnectByPlatformData, ThrowOnError>): RequestResult<GetV1ConnectByPlatformResponses, GetV1ConnectByPlatformErrors, ThrowOnError>;
3424
3682
  /**
@@ -3429,6 +3687,8 @@ declare class Connect extends HeyApiClient {
3429
3687
  bluesky<ThrowOnError extends boolean = false>(options: Options<PostV1ConnectBlueskyAuthData, ThrowOnError>): RequestResult<unknown, PostV1ConnectBlueskyAuthErrors, ThrowOnError>;
3430
3688
  private _linkedin?;
3431
3689
  get linkedin(): Linkedin;
3690
+ private _facebook?;
3691
+ get facebook(): Facebook;
3432
3692
  private _integrations?;
3433
3693
  get integrations(): Integrations;
3434
3694
  }
@@ -3715,6 +3975,6 @@ declare class APIUserAbortError extends APIConnectionError {
3715
3975
  constructor(options?: ErrorOptions);
3716
3976
  }
3717
3977
 
3718
- declare const VERSION = "0.8.2";
3978
+ declare const VERSION = "0.8.3";
3719
3979
 
3720
- export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, AuthenticationError, BadRequestError, type BlueskyConfigurations, type ClientOptions, ConflictError, type DeleteV1AppsByIdData, type DeleteV1AppsByIdError, type DeleteV1AppsByIdErrors, type DeleteV1AppsByIdResponse, type DeleteV1AppsByIdResponses, type DeleteV1ConnectIntegrationsByIdData, type DeleteV1ConnectIntegrationsByIdError, type DeleteV1ConnectIntegrationsByIdErrors, type DeleteV1ConnectIntegrationsByIdResponse, type DeleteV1ConnectIntegrationsByIdResponses, type DeleteV1NotificationsByIdData, type DeleteV1NotificationsByIdError, type DeleteV1NotificationsByIdErrors, type DeleteV1NotificationsByIdResponse, type DeleteV1NotificationsByIdResponses, type DeleteV1PostsByPostIdData, type DeleteV1PostsByPostIdError, type DeleteV1PostsByPostIdErrors, type DeleteV1PostsByPostIdResponse, type DeleteV1PostsByPostIdResponses, type DeleteV1PostsScheduledByPostIdData, type DeleteV1PostsScheduledByPostIdError, type DeleteV1PostsScheduledByPostIdErrors, type DeleteV1PostsScheduledByPostIdResponse, type DeleteV1PostsScheduledByPostIdResponses, type DeleteV1ProfilesByIdData, type DeleteV1ProfilesByIdError, type DeleteV1ProfilesByIdErrors, type DeleteV1ProfilesByIdResponse, type DeleteV1ProfilesByIdResponses, type ErrorResponse, type FacebookConfigurations, type GetV1AnalyticsData, type GetV1AnalyticsError, type GetV1AnalyticsErrors, type GetV1AnalyticsResponse, type GetV1AnalyticsResponses, type GetV1AppsByIdData, type GetV1AppsByIdError, type GetV1AppsByIdErrors, type GetV1AppsByIdResponse, type GetV1AppsByIdResponses, type GetV1AppsData, type GetV1AppsResponse, type GetV1AppsResponses, type GetV1ConnectByPlatformData, type GetV1ConnectByPlatformError, type GetV1ConnectByPlatformErrors, type GetV1ConnectByPlatformResponse, type GetV1ConnectByPlatformResponses, type GetV1ConnectIntegrationsData, type GetV1ConnectIntegrationsResponse, type GetV1ConnectIntegrationsResponses, type GetV1ConnectLinkedinSelectionByTokenData, type GetV1ConnectLinkedinSelectionByTokenError, type GetV1ConnectLinkedinSelectionByTokenErrors, type GetV1ConnectLinkedinSelectionByTokenResponse, type GetV1ConnectLinkedinSelectionByTokenResponses, type GetV1HealthAuthData, type GetV1HealthAuthResponse, type GetV1HealthAuthResponses, type GetV1HealthData, type GetV1HealthResponse, type GetV1HealthResponses, type GetV1NotificationsByIdData, type GetV1NotificationsByIdError, type GetV1NotificationsByIdErrors, type GetV1NotificationsByIdResponse, type GetV1NotificationsByIdResponses, type GetV1NotificationsData, type GetV1NotificationsResponse, type GetV1NotificationsResponses, type GetV1PinterestBoardsData, type GetV1PinterestBoardsError, type GetV1PinterestBoardsErrors, type GetV1PinterestBoardsResponse, type GetV1PinterestBoardsResponses, type GetV1PlatformsData, type GetV1PlatformsResponse, type GetV1PlatformsResponses, type GetV1PostsByPostIdData, type GetV1PostsByPostIdError, type GetV1PostsByPostIdErrors, type GetV1PostsByPostIdResponse, type GetV1PostsByPostIdResponses, type GetV1PostsData, type GetV1PostsError, type GetV1PostsErrors, type GetV1PostsResponse, type GetV1PostsResponses, type GetV1PostsScheduledData, type GetV1PostsScheduledResponse, type GetV1PostsScheduledResponses, type GetV1ProfilesByIdData, type GetV1ProfilesByIdError, type GetV1ProfilesByIdErrors, type GetV1ProfilesByIdResponse, type GetV1ProfilesByIdResponses, type GetV1ProfilesData, type GetV1ProfilesResponse, type GetV1ProfilesResponses, type GetV1TiktokCreatorInfoData, type GetV1TiktokCreatorInfoError, type GetV1TiktokCreatorInfoErrors, type GetV1TiktokCreatorInfoResponse, type GetV1TiktokCreatorInfoResponses, type GetV1UsageData, type GetV1UsageError, type GetV1UsageErrors, type GetV1UsageResponse, type GetV1UsageResponses, type GoogleBusinessConfigurations, type InstagramConfigurations, InternalServerError, type LinkedInConfigurations, type LinkedInMention, NotFoundError, type PatchV1AppsByIdData, type PatchV1AppsByIdError, type PatchV1AppsByIdErrors, type PatchV1AppsByIdResponse, type PatchV1AppsByIdResponses, type PatchV1NotificationsByIdData, type PatchV1NotificationsByIdError, type PatchV1NotificationsByIdErrors, type PatchV1NotificationsByIdResponse, type PatchV1NotificationsByIdResponses, type PatchV1PostsScheduledByPostIdData, type PatchV1PostsScheduledByPostIdError, type PatchV1PostsScheduledByPostIdErrors, type PatchV1PostsScheduledByPostIdResponse, type PatchV1PostsScheduledByPostIdResponses, type PatchV1ProfilesByIdData, type PatchV1ProfilesByIdError, type PatchV1ProfilesByIdErrors, type PatchV1ProfilesByIdResponse, type PatchV1ProfilesByIdResponses, PermissionDeniedError, type PinterestConfigurations, type Platform, type PostPayload, PostPeer, PostPeerError, type PostV1AiImageData, type PostV1AiImageError, type PostV1AiImageErrors, type PostV1AiImageResponse, type PostV1AiImageResponses, type PostV1AiWriteData, type PostV1AiWriteError, type PostV1AiWriteErrors, type PostV1AiWriteResponse, type PostV1AiWriteResponses, type PostV1AppsData, type PostV1AppsError, type PostV1AppsErrors, type PostV1AppsResponse, type PostV1AppsResponses, type PostV1ConnectBlueskyAuthData, type PostV1ConnectBlueskyAuthError, type PostV1ConnectBlueskyAuthErrors, type PostV1ConnectLinkedinSelectionByTokenData, type PostV1ConnectLinkedinSelectionByTokenError, type PostV1ConnectLinkedinSelectionByTokenErrors, type PostV1ConnectLinkedinSelectionByTokenResponse, type PostV1ConnectLinkedinSelectionByTokenResponses, type PostV1MediaUploadData, type PostV1MediaUploadError, type PostV1MediaUploadErrors, type PostV1MediaUploadResponse, type PostV1MediaUploadResponses, type PostV1NotificationsData, type PostV1NotificationsError, type PostV1NotificationsErrors, type PostV1NotificationsResponse, type PostV1NotificationsResponses, type PostV1NotificationsTestData, type PostV1NotificationsTestError, type PostV1NotificationsTestErrors, type PostV1NotificationsTestResponse, type PostV1NotificationsTestResponses, type PostV1PostsData, type PostV1PostsError, type PostV1PostsErrors, type PostV1PostsResponse, type PostV1PostsResponses, type PostV1ProfilesData, type PostV1ProfilesResponse, type PostV1ProfilesResponses, type PutV1PostsScheduledByPostIdData, type PutV1PostsScheduledByPostIdError, type PutV1PostsScheduledByPostIdErrors, type PutV1PostsScheduledByPostIdResponse, type PutV1PostsScheduledByPostIdResponses, RateLimitError, type SortOrder, type Status, type ThreadsConfigurations, type TikTokConfigurations, type TwitterConfigurations, UnprocessableEntityError, VERSION, type YouTubeConfigurations, PostPeer as default };
3980
+ export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, AuthenticationError, BadRequestError, type BlueskyConfigurations, type ClientOptions, ConflictError, type DeleteV1AppsByIdData, type DeleteV1AppsByIdError, type DeleteV1AppsByIdErrors, type DeleteV1AppsByIdResponse, type DeleteV1AppsByIdResponses, type DeleteV1ConnectIntegrationsByIdData, type DeleteV1ConnectIntegrationsByIdError, type DeleteV1ConnectIntegrationsByIdErrors, type DeleteV1ConnectIntegrationsByIdResponse, type DeleteV1ConnectIntegrationsByIdResponses, type DeleteV1NotificationsByIdData, type DeleteV1NotificationsByIdError, type DeleteV1NotificationsByIdErrors, type DeleteV1NotificationsByIdResponse, type DeleteV1NotificationsByIdResponses, type DeleteV1PostsByPostIdData, type DeleteV1PostsByPostIdError, type DeleteV1PostsByPostIdErrors, type DeleteV1PostsByPostIdResponse, type DeleteV1PostsByPostIdResponses, type DeleteV1PostsScheduledByPostIdData, type DeleteV1PostsScheduledByPostIdError, type DeleteV1PostsScheduledByPostIdErrors, type DeleteV1PostsScheduledByPostIdResponse, type DeleteV1PostsScheduledByPostIdResponses, type DeleteV1ProfilesByIdData, type DeleteV1ProfilesByIdError, type DeleteV1ProfilesByIdErrors, type DeleteV1ProfilesByIdResponse, type DeleteV1ProfilesByIdResponses, type ErrorResponse, type FacebookConfigurations, type GetV1AnalyticsData, type GetV1AnalyticsError, type GetV1AnalyticsErrors, type GetV1AnalyticsResponse, type GetV1AnalyticsResponses, type GetV1AppsByIdData, type GetV1AppsByIdError, type GetV1AppsByIdErrors, type GetV1AppsByIdResponse, type GetV1AppsByIdResponses, type GetV1AppsData, type GetV1AppsResponse, type GetV1AppsResponses, type GetV1ConnectByPlatformData, type GetV1ConnectByPlatformError, type GetV1ConnectByPlatformErrors, type GetV1ConnectByPlatformResponse, type GetV1ConnectByPlatformResponses, type GetV1ConnectFacebookSelectionByTokenData, type GetV1ConnectFacebookSelectionByTokenError, type GetV1ConnectFacebookSelectionByTokenErrors, type GetV1ConnectFacebookSelectionByTokenResponse, type GetV1ConnectFacebookSelectionByTokenResponses, type GetV1ConnectIntegrationsByIdData, type GetV1ConnectIntegrationsByIdError, type GetV1ConnectIntegrationsByIdErrors, type GetV1ConnectIntegrationsByIdResponse, type GetV1ConnectIntegrationsByIdResponses, type GetV1ConnectIntegrationsData, type GetV1ConnectIntegrationsResponse, type GetV1ConnectIntegrationsResponses, type GetV1ConnectLinkedinSelectionByTokenData, type GetV1ConnectLinkedinSelectionByTokenError, type GetV1ConnectLinkedinSelectionByTokenErrors, type GetV1ConnectLinkedinSelectionByTokenResponse, type GetV1ConnectLinkedinSelectionByTokenResponses, type GetV1HealthAuthData, type GetV1HealthAuthResponse, type GetV1HealthAuthResponses, type GetV1HealthData, type GetV1HealthResponse, type GetV1HealthResponses, type GetV1NotificationsByIdData, type GetV1NotificationsByIdError, type GetV1NotificationsByIdErrors, type GetV1NotificationsByIdResponse, type GetV1NotificationsByIdResponses, type GetV1NotificationsData, type GetV1NotificationsResponse, type GetV1NotificationsResponses, type GetV1PinterestBoardsData, type GetV1PinterestBoardsError, type GetV1PinterestBoardsErrors, type GetV1PinterestBoardsResponse, type GetV1PinterestBoardsResponses, type GetV1PlatformsData, type GetV1PlatformsResponse, type GetV1PlatformsResponses, type GetV1PostsByPostIdData, type GetV1PostsByPostIdError, type GetV1PostsByPostIdErrors, type GetV1PostsByPostIdResponse, type GetV1PostsByPostIdResponses, type GetV1PostsData, type GetV1PostsError, type GetV1PostsErrors, type GetV1PostsResponse, type GetV1PostsResponses, type GetV1PostsScheduledData, type GetV1PostsScheduledResponse, type GetV1PostsScheduledResponses, type GetV1ProfilesByIdData, type GetV1ProfilesByIdError, type GetV1ProfilesByIdErrors, type GetV1ProfilesByIdResponse, type GetV1ProfilesByIdResponses, type GetV1ProfilesData, type GetV1ProfilesResponse, type GetV1ProfilesResponses, type GetV1TiktokCreatorInfoData, type GetV1TiktokCreatorInfoError, type GetV1TiktokCreatorInfoErrors, type GetV1TiktokCreatorInfoResponse, type GetV1TiktokCreatorInfoResponses, type GetV1UsageData, type GetV1UsageError, type GetV1UsageErrors, type GetV1UsageResponse, type GetV1UsageResponses, type GoogleBusinessConfigurations, type InstagramConfigurations, InternalServerError, type LinkedInConfigurations, type LinkedInMention, NotFoundError, type PatchV1AppsByIdData, type PatchV1AppsByIdError, type PatchV1AppsByIdErrors, type PatchV1AppsByIdResponse, type PatchV1AppsByIdResponses, type PatchV1NotificationsByIdData, type PatchV1NotificationsByIdError, type PatchV1NotificationsByIdErrors, type PatchV1NotificationsByIdResponse, type PatchV1NotificationsByIdResponses, type PatchV1PostsScheduledByPostIdData, type PatchV1PostsScheduledByPostIdError, type PatchV1PostsScheduledByPostIdErrors, type PatchV1PostsScheduledByPostIdResponse, type PatchV1PostsScheduledByPostIdResponses, type PatchV1ProfilesByIdData, type PatchV1ProfilesByIdError, type PatchV1ProfilesByIdErrors, type PatchV1ProfilesByIdResponse, type PatchV1ProfilesByIdResponses, PermissionDeniedError, type PinterestConfigurations, type Platform, type PostPayload, PostPeer, PostPeerError, type PostV1AiImageData, type PostV1AiImageError, type PostV1AiImageErrors, type PostV1AiImageResponse, type PostV1AiImageResponses, type PostV1AiWriteData, type PostV1AiWriteError, type PostV1AiWriteErrors, type PostV1AiWriteResponse, type PostV1AiWriteResponses, type PostV1AppsData, type PostV1AppsError, type PostV1AppsErrors, type PostV1AppsResponse, type PostV1AppsResponses, type PostV1ConnectBlueskyAuthData, type PostV1ConnectBlueskyAuthError, type PostV1ConnectBlueskyAuthErrors, type PostV1ConnectFacebookSelectionByTokenData, type PostV1ConnectFacebookSelectionByTokenError, type PostV1ConnectFacebookSelectionByTokenErrors, type PostV1ConnectFacebookSelectionByTokenResponse, type PostV1ConnectFacebookSelectionByTokenResponses, type PostV1ConnectLinkedinSelectionByTokenData, type PostV1ConnectLinkedinSelectionByTokenError, type PostV1ConnectLinkedinSelectionByTokenErrors, type PostV1ConnectLinkedinSelectionByTokenResponse, type PostV1ConnectLinkedinSelectionByTokenResponses, type PostV1MediaUploadData, type PostV1MediaUploadError, type PostV1MediaUploadErrors, type PostV1MediaUploadResponse, type PostV1MediaUploadResponses, type PostV1NotificationsData, type PostV1NotificationsError, type PostV1NotificationsErrors, type PostV1NotificationsResponse, type PostV1NotificationsResponses, type PostV1NotificationsTestData, type PostV1NotificationsTestError, type PostV1NotificationsTestErrors, type PostV1NotificationsTestResponse, type PostV1NotificationsTestResponses, type PostV1PostsData, type PostV1PostsError, type PostV1PostsErrors, type PostV1PostsResponse, type PostV1PostsResponses, type PostV1ProfilesData, type PostV1ProfilesResponse, type PostV1ProfilesResponses, type PutV1PostsScheduledByPostIdData, type PutV1PostsScheduledByPostIdError, type PutV1PostsScheduledByPostIdErrors, type PutV1PostsScheduledByPostIdResponse, type PutV1PostsScheduledByPostIdResponses, RateLimitError, type SortOrder, type Status, type ThreadsConfigurations, type TikTokConfigurations, type TwitterConfigurations, UnprocessableEntityError, VERSION, type YouTubeConfigurations, PostPeer as default };
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=linkedin, and selectionToken.
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 });
@@ -1592,7 +1636,7 @@ var createAPIError = /* @__PURE__ */ __name((response, body) => {
1592
1636
  }, "createAPIError");
1593
1637
 
1594
1638
  // src/version.ts
1595
- var VERSION = "0.8.2";
1639
+ var VERSION = "0.8.3";
1596
1640
 
1597
1641
  // src/client.ts
1598
1642
  var DEFAULT_BASE_URL = "https://api.postpeer.dev";