@postrun/js 4.0.0 → 4.2.0

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.cjs CHANGED
@@ -822,6 +822,9 @@ var zErrorCode = z__namespace.enum([
822
822
  "not_implemented",
823
823
  "connection_discovery_failed",
824
824
  "tiktok_creator_info_unavailable",
825
+ "tiktok_analytics_unavailable",
826
+ "instagram_analytics_unavailable",
827
+ "facebook_analytics_unavailable",
825
828
  "media_processing",
826
829
  "media_upload_init_failed",
827
830
  "media_upload_incomplete",
@@ -866,6 +869,8 @@ var zErrorCode = z__namespace.enum([
866
869
  "tag_limit_exceeded",
867
870
  "reel_field_on_non_reel",
868
871
  "field_placement_invalid",
872
+ "title_too_long",
873
+ "characters_not_allowed",
869
874
  "media_not_ready",
870
875
  "media_failed",
871
876
  "media_unsupported",
@@ -920,6 +925,14 @@ var zErrorCode = z__namespace.enum([
920
925
  "tiktok_media_pull_failed",
921
926
  "tiktok_server_error",
922
927
  "tiktok_publish_failed",
928
+ "youtube_long_upload_not_allowed",
929
+ "youtube_not_authorized",
930
+ "youtube_daily_limit_reached",
931
+ "youtube_upload_failed",
932
+ "youtube_upload_unconfirmed",
933
+ "youtube_video_rejected",
934
+ "youtube_processing_failed",
935
+ "youtube_thumbnail_failed",
923
936
  "post_publish_failed",
924
937
  "post_partially_published",
925
938
  "connection_platform_mismatch",
@@ -928,7 +941,9 @@ var zErrorCode = z__namespace.enum([
928
941
  "publish_outcome_unknown",
929
942
  "plan_limit_reached",
930
943
  "billing_required",
931
- "x_link_requires_paid_plan"
944
+ "x_link_requires_paid_plan",
945
+ "analytics_not_supported",
946
+ "analytics_no_data"
932
947
  ]);
933
948
  var zErrorSource = z__namespace.object({
934
949
  platform: z__namespace.enum([
@@ -957,6 +972,144 @@ var zProfile = z__namespace.object({
957
972
  created_at: z__namespace.string().nullable(),
958
973
  updated_at: z__namespace.string().nullable()
959
974
  });
975
+ var zYouTubePostSettings = z__namespace.object({
976
+ title: z__namespace.string().optional(),
977
+ privacy_status: z__namespace.enum([
978
+ "public",
979
+ "unlisted",
980
+ "private"
981
+ ]).optional(),
982
+ self_declared_made_for_kids: z__namespace.boolean().optional(),
983
+ contains_synthetic_media: z__namespace.boolean().optional(),
984
+ tags: z__namespace.array(z__namespace.string()).optional(),
985
+ category_id: z__namespace.string().regex(/^[0-9]+$/).optional(),
986
+ thumbnail_media_id: z__namespace.string().optional()
987
+ });
988
+ var zTikTokPostMetrics = z__namespace.object({
989
+ platform: z__namespace.literal("tiktok"),
990
+ video_views: z__namespace.number().nullable(),
991
+ reach: z__namespace.number().nullable(),
992
+ likes: z__namespace.number().nullable(),
993
+ comments: z__namespace.number().nullable(),
994
+ shares: z__namespace.number().nullable(),
995
+ favorites: z__namespace.number().nullable(),
996
+ average_time_watched: z__namespace.number().nullable(),
997
+ total_time_watched: z__namespace.number().nullable(),
998
+ full_video_watched_rate: z__namespace.number().nullable(),
999
+ new_followers: z__namespace.number().nullable(),
1000
+ profile_views: z__namespace.number().nullable()
1001
+ });
1002
+ var zTikTokAccountDay = z__namespace.object({
1003
+ date: z__namespace.string(),
1004
+ followers_count: z__namespace.number().nullable(),
1005
+ daily_new_followers: z__namespace.number().nullable(),
1006
+ daily_lost_followers: z__namespace.number().nullable(),
1007
+ video_views: z__namespace.number().nullable(),
1008
+ profile_views: z__namespace.number().nullable(),
1009
+ likes: z__namespace.number().nullable(),
1010
+ comments: z__namespace.number().nullable(),
1011
+ shares: z__namespace.number().nullable()
1012
+ });
1013
+ var zTikTokAccountMetrics = z__namespace.object({
1014
+ platform: z__namespace.literal("tiktok"),
1015
+ followers_count: z__namespace.number().nullable(),
1016
+ following_count: z__namespace.number().nullable(),
1017
+ total_likes: z__namespace.number().nullable(),
1018
+ videos_count: z__namespace.number().nullable(),
1019
+ daily: z__namespace.array(zTikTokAccountDay)
1020
+ });
1021
+ var zInstagramPostMetrics = z__namespace.object({
1022
+ platform: z__namespace.literal("instagram"),
1023
+ views: z__namespace.number().nullable(),
1024
+ reach: z__namespace.number().nullable(),
1025
+ likes: z__namespace.number().nullable(),
1026
+ comments: z__namespace.number().nullable(),
1027
+ shares: z__namespace.number().nullable(),
1028
+ saved: z__namespace.number().nullable(),
1029
+ reposts: z__namespace.number().nullable(),
1030
+ total_interactions: z__namespace.number().nullable(),
1031
+ follows: z__namespace.number().nullable(),
1032
+ profile_visits: z__namespace.number().nullable(),
1033
+ profile_activity: z__namespace.number().nullable(),
1034
+ ig_reels_avg_watch_time: z__namespace.number().nullable(),
1035
+ ig_reels_video_view_total_time: z__namespace.number().nullable(),
1036
+ reels_skip_rate: z__namespace.number().nullable()
1037
+ });
1038
+ var zInstagramAccountDay = z__namespace.object({
1039
+ date: z__namespace.string(),
1040
+ reach: z__namespace.number().nullable()
1041
+ });
1042
+ var zInstagramAccountMetrics = z__namespace.object({
1043
+ platform: z__namespace.literal("instagram"),
1044
+ followers_count: z__namespace.number().nullable(),
1045
+ follows_count: z__namespace.number().nullable(),
1046
+ media_count: z__namespace.number().nullable(),
1047
+ last_30_days: z__namespace.object({
1048
+ views: z__namespace.number().nullable(),
1049
+ reach: z__namespace.number().nullable(),
1050
+ accounts_engaged: z__namespace.number().nullable(),
1051
+ total_interactions: z__namespace.number().nullable(),
1052
+ likes: z__namespace.number().nullable(),
1053
+ comments: z__namespace.number().nullable(),
1054
+ shares: z__namespace.number().nullable(),
1055
+ saves: z__namespace.number().nullable(),
1056
+ reposts: z__namespace.number().nullable(),
1057
+ replies: z__namespace.number().nullable(),
1058
+ profile_links_taps: z__namespace.number().nullable(),
1059
+ follows_and_unfollows: z__namespace.record(z__namespace.string(), z__namespace.number()).nullable()
1060
+ }),
1061
+ daily: z__namespace.array(zInstagramAccountDay)
1062
+ });
1063
+ var zFacebookPostMetrics = z__namespace.object({
1064
+ platform: z__namespace.literal("facebook_page"),
1065
+ post_media_view: z__namespace.number().nullable(),
1066
+ post_total_media_view_unique: z__namespace.number().nullable(),
1067
+ post_reactions_by_type_total: z__namespace.record(z__namespace.string(), z__namespace.number()).nullable(),
1068
+ post_clicks: z__namespace.number().nullable(),
1069
+ post_clicks_by_type: z__namespace.record(z__namespace.string(), z__namespace.number()).nullable(),
1070
+ comments: z__namespace.number().nullable(),
1071
+ shares: z__namespace.number().nullable(),
1072
+ blue_reels_play_count: z__namespace.number().nullable(),
1073
+ fb_reels_total_plays: z__namespace.number().nullable(),
1074
+ fb_reels_replay_count: z__namespace.number().nullable(),
1075
+ post_video_avg_time_watched: z__namespace.number().nullable(),
1076
+ post_video_view_time: z__namespace.number().nullable(),
1077
+ post_video_followers: z__namespace.number().nullable(),
1078
+ post_video_likes_by_reaction_type: z__namespace.record(z__namespace.string(), z__namespace.number()).nullable()
1079
+ });
1080
+ var zFacebookPageDay = z__namespace.object({
1081
+ date: z__namespace.string(),
1082
+ page_media_view: z__namespace.number().nullable(),
1083
+ page_total_media_view_unique: z__namespace.number().nullable(),
1084
+ page_follows: z__namespace.number().nullable(),
1085
+ page_daily_follows_unique: z__namespace.number().nullable(),
1086
+ page_daily_unfollows_unique: z__namespace.number().nullable(),
1087
+ page_post_engagements: z__namespace.number().nullable(),
1088
+ page_views_total: z__namespace.number().nullable(),
1089
+ page_video_views: z__namespace.number().nullable(),
1090
+ page_total_actions: z__namespace.number().nullable()
1091
+ });
1092
+ var zFacebookPageMetrics = z__namespace.object({
1093
+ platform: z__namespace.literal("facebook_page"),
1094
+ followers_count: z__namespace.number().nullable(),
1095
+ daily: z__namespace.array(zFacebookPageDay)
1096
+ });
1097
+ var zPostMetrics = z__namespace.union([
1098
+ zTikTokPostMetrics,
1099
+ zInstagramPostMetrics,
1100
+ zFacebookPostMetrics
1101
+ ]);
1102
+ var zAccountMetrics = z__namespace.union([
1103
+ zTikTokAccountMetrics,
1104
+ zInstagramAccountMetrics,
1105
+ zFacebookPageMetrics
1106
+ ]);
1107
+ z__namespace.object({
1108
+ object: z__namespace.literal("connection_analytics"),
1109
+ connection_id: z__namespace.string(),
1110
+ fetched_at: z__namespace.iso.datetime({ offset: true }),
1111
+ metrics: zAccountMetrics
1112
+ });
960
1113
  var zDiscoverableAccount = z__namespace.object({
961
1114
  external_account_id: z__namespace.string(),
962
1115
  name: z__namespace.string().nullable(),
@@ -1148,15 +1301,34 @@ var zPostPlatform = z__namespace.enum([
1148
1301
  "linkedin",
1149
1302
  "facebook_page",
1150
1303
  "instagram",
1151
- "tiktok"
1304
+ "tiktok",
1305
+ "youtube"
1152
1306
  ]);
1307
+ var zPostVariantAnalytics = z__namespace.object({
1308
+ variant_id: z__namespace.string(),
1309
+ connection_id: z__namespace.string().nullable(),
1310
+ platform: zPostPlatform,
1311
+ metrics: zPostMetrics.nullable(),
1312
+ error: z__namespace.object({
1313
+ code: z__namespace.enum(["analytics_not_supported", "analytics_no_data"]),
1314
+ message: z__namespace.string(),
1315
+ display_error: z__namespace.string()
1316
+ }).nullable()
1317
+ });
1318
+ z__namespace.object({
1319
+ object: z__namespace.literal("post_analytics"),
1320
+ post_id: z__namespace.string(),
1321
+ fetched_at: z__namespace.iso.datetime({ offset: true }),
1322
+ variants: z__namespace.array(zPostVariantAnalytics)
1323
+ });
1153
1324
  var zPostType = z__namespace.enum([
1154
1325
  "text",
1155
1326
  "single_image",
1156
1327
  "multi_image",
1157
1328
  "video",
1158
1329
  "reel",
1159
- "carousel"
1330
+ "carousel",
1331
+ "short"
1160
1332
  ]);
1161
1333
  var zPostStatus = z__namespace.enum([
1162
1334
  "draft",
@@ -1190,7 +1362,8 @@ var zConnection = z__namespace.object({
1190
1362
  "linkedin",
1191
1363
  "facebook_page",
1192
1364
  "instagram",
1193
- "tiktok"
1365
+ "tiktok",
1366
+ "youtube"
1194
1367
  ]),
1195
1368
  kind: zConnectionKind,
1196
1369
  status: zConnectionStatus,
@@ -1282,6 +1455,9 @@ var zPostVariant = z__namespace.union([
1282
1455
  "not_implemented",
1283
1456
  "connection_discovery_failed",
1284
1457
  "tiktok_creator_info_unavailable",
1458
+ "tiktok_analytics_unavailable",
1459
+ "instagram_analytics_unavailable",
1460
+ "facebook_analytics_unavailable",
1285
1461
  "media_processing",
1286
1462
  "media_upload_init_failed",
1287
1463
  "media_upload_incomplete",
@@ -1326,6 +1502,8 @@ var zPostVariant = z__namespace.union([
1326
1502
  "tag_limit_exceeded",
1327
1503
  "reel_field_on_non_reel",
1328
1504
  "field_placement_invalid",
1505
+ "title_too_long",
1506
+ "characters_not_allowed",
1329
1507
  "media_not_ready",
1330
1508
  "media_failed",
1331
1509
  "media_unsupported",
@@ -1380,6 +1558,14 @@ var zPostVariant = z__namespace.union([
1380
1558
  "tiktok_media_pull_failed",
1381
1559
  "tiktok_server_error",
1382
1560
  "tiktok_publish_failed",
1561
+ "youtube_long_upload_not_allowed",
1562
+ "youtube_not_authorized",
1563
+ "youtube_daily_limit_reached",
1564
+ "youtube_upload_failed",
1565
+ "youtube_upload_unconfirmed",
1566
+ "youtube_video_rejected",
1567
+ "youtube_processing_failed",
1568
+ "youtube_thumbnail_failed",
1383
1569
  "post_publish_failed",
1384
1570
  "post_partially_published",
1385
1571
  "connection_platform_mismatch",
@@ -1388,7 +1574,9 @@ var zPostVariant = z__namespace.union([
1388
1574
  "publish_outcome_unknown",
1389
1575
  "plan_limit_reached",
1390
1576
  "billing_required",
1391
- "x_link_requires_paid_plan"
1577
+ "x_link_requires_paid_plan",
1578
+ "analytics_not_supported",
1579
+ "analytics_no_data"
1392
1580
  ]),
1393
1581
  message: z__namespace.string(),
1394
1582
  source: zErrorSource.optional(),
@@ -1461,6 +1649,9 @@ var zPostVariant = z__namespace.union([
1461
1649
  "not_implemented",
1462
1650
  "connection_discovery_failed",
1463
1651
  "tiktok_creator_info_unavailable",
1652
+ "tiktok_analytics_unavailable",
1653
+ "instagram_analytics_unavailable",
1654
+ "facebook_analytics_unavailable",
1464
1655
  "media_processing",
1465
1656
  "media_upload_init_failed",
1466
1657
  "media_upload_incomplete",
@@ -1505,6 +1696,8 @@ var zPostVariant = z__namespace.union([
1505
1696
  "tag_limit_exceeded",
1506
1697
  "reel_field_on_non_reel",
1507
1698
  "field_placement_invalid",
1699
+ "title_too_long",
1700
+ "characters_not_allowed",
1508
1701
  "media_not_ready",
1509
1702
  "media_failed",
1510
1703
  "media_unsupported",
@@ -1559,6 +1752,14 @@ var zPostVariant = z__namespace.union([
1559
1752
  "tiktok_media_pull_failed",
1560
1753
  "tiktok_server_error",
1561
1754
  "tiktok_publish_failed",
1755
+ "youtube_long_upload_not_allowed",
1756
+ "youtube_not_authorized",
1757
+ "youtube_daily_limit_reached",
1758
+ "youtube_upload_failed",
1759
+ "youtube_upload_unconfirmed",
1760
+ "youtube_video_rejected",
1761
+ "youtube_processing_failed",
1762
+ "youtube_thumbnail_failed",
1562
1763
  "post_publish_failed",
1563
1764
  "post_partially_published",
1564
1765
  "connection_platform_mismatch",
@@ -1567,7 +1768,9 @@ var zPostVariant = z__namespace.union([
1567
1768
  "publish_outcome_unknown",
1568
1769
  "plan_limit_reached",
1569
1770
  "billing_required",
1570
- "x_link_requires_paid_plan"
1771
+ "x_link_requires_paid_plan",
1772
+ "analytics_not_supported",
1773
+ "analytics_no_data"
1571
1774
  ]),
1572
1775
  message: z__namespace.string(),
1573
1776
  source: zErrorSource.optional(),
@@ -1625,6 +1828,9 @@ var zPostVariant = z__namespace.union([
1625
1828
  "not_implemented",
1626
1829
  "connection_discovery_failed",
1627
1830
  "tiktok_creator_info_unavailable",
1831
+ "tiktok_analytics_unavailable",
1832
+ "instagram_analytics_unavailable",
1833
+ "facebook_analytics_unavailable",
1628
1834
  "media_processing",
1629
1835
  "media_upload_init_failed",
1630
1836
  "media_upload_incomplete",
@@ -1669,6 +1875,8 @@ var zPostVariant = z__namespace.union([
1669
1875
  "tag_limit_exceeded",
1670
1876
  "reel_field_on_non_reel",
1671
1877
  "field_placement_invalid",
1878
+ "title_too_long",
1879
+ "characters_not_allowed",
1672
1880
  "media_not_ready",
1673
1881
  "media_failed",
1674
1882
  "media_unsupported",
@@ -1723,6 +1931,14 @@ var zPostVariant = z__namespace.union([
1723
1931
  "tiktok_media_pull_failed",
1724
1932
  "tiktok_server_error",
1725
1933
  "tiktok_publish_failed",
1934
+ "youtube_long_upload_not_allowed",
1935
+ "youtube_not_authorized",
1936
+ "youtube_daily_limit_reached",
1937
+ "youtube_upload_failed",
1938
+ "youtube_upload_unconfirmed",
1939
+ "youtube_video_rejected",
1940
+ "youtube_processing_failed",
1941
+ "youtube_thumbnail_failed",
1726
1942
  "post_publish_failed",
1727
1943
  "post_partially_published",
1728
1944
  "connection_platform_mismatch",
@@ -1731,7 +1947,9 @@ var zPostVariant = z__namespace.union([
1731
1947
  "publish_outcome_unknown",
1732
1948
  "plan_limit_reached",
1733
1949
  "billing_required",
1734
- "x_link_requires_paid_plan"
1950
+ "x_link_requires_paid_plan",
1951
+ "analytics_not_supported",
1952
+ "analytics_no_data"
1735
1953
  ]),
1736
1954
  message: z__namespace.string(),
1737
1955
  source: zErrorSource.optional(),
@@ -1790,6 +2008,9 @@ var zPostVariant = z__namespace.union([
1790
2008
  "not_implemented",
1791
2009
  "connection_discovery_failed",
1792
2010
  "tiktok_creator_info_unavailable",
2011
+ "tiktok_analytics_unavailable",
2012
+ "instagram_analytics_unavailable",
2013
+ "facebook_analytics_unavailable",
1793
2014
  "media_processing",
1794
2015
  "media_upload_init_failed",
1795
2016
  "media_upload_incomplete",
@@ -1834,6 +2055,8 @@ var zPostVariant = z__namespace.union([
1834
2055
  "tag_limit_exceeded",
1835
2056
  "reel_field_on_non_reel",
1836
2057
  "field_placement_invalid",
2058
+ "title_too_long",
2059
+ "characters_not_allowed",
1837
2060
  "media_not_ready",
1838
2061
  "media_failed",
1839
2062
  "media_unsupported",
@@ -1888,6 +2111,14 @@ var zPostVariant = z__namespace.union([
1888
2111
  "tiktok_media_pull_failed",
1889
2112
  "tiktok_server_error",
1890
2113
  "tiktok_publish_failed",
2114
+ "youtube_long_upload_not_allowed",
2115
+ "youtube_not_authorized",
2116
+ "youtube_daily_limit_reached",
2117
+ "youtube_upload_failed",
2118
+ "youtube_upload_unconfirmed",
2119
+ "youtube_video_rejected",
2120
+ "youtube_processing_failed",
2121
+ "youtube_thumbnail_failed",
1891
2122
  "post_publish_failed",
1892
2123
  "post_partially_published",
1893
2124
  "connection_platform_mismatch",
@@ -1896,7 +2127,9 @@ var zPostVariant = z__namespace.union([
1896
2127
  "publish_outcome_unknown",
1897
2128
  "plan_limit_reached",
1898
2129
  "billing_required",
1899
- "x_link_requires_paid_plan"
2130
+ "x_link_requires_paid_plan",
2131
+ "analytics_not_supported",
2132
+ "analytics_no_data"
1900
2133
  ]),
1901
2134
  message: z__namespace.string(),
1902
2135
  source: zErrorSource.optional(),
@@ -1959,6 +2192,176 @@ var zPostVariant = z__namespace.union([
1959
2192
  "not_implemented",
1960
2193
  "connection_discovery_failed",
1961
2194
  "tiktok_creator_info_unavailable",
2195
+ "tiktok_analytics_unavailable",
2196
+ "instagram_analytics_unavailable",
2197
+ "facebook_analytics_unavailable",
2198
+ "media_processing",
2199
+ "media_upload_init_failed",
2200
+ "media_upload_incomplete",
2201
+ "media_upload_invalid_parts",
2202
+ "not_publishable",
2203
+ "post_not_retryable",
2204
+ "invalid_connection",
2205
+ "invalid_media",
2206
+ "profile_scope_invalid",
2207
+ "media_unprobeable",
2208
+ "media_too_large",
2209
+ "media_aspect_ratio_unsupported",
2210
+ "media_resolution_too_low",
2211
+ "media_gif_unsupported",
2212
+ "media_format_recompressed",
2213
+ "media_resolution_downscaled",
2214
+ "video_container_unsupported",
2215
+ "video_codec_unsupported",
2216
+ "video_audio_codec_unsupported",
2217
+ "video_too_large",
2218
+ "video_too_small",
2219
+ "video_dimensions_unsupported",
2220
+ "video_dimensions_too_large",
2221
+ "video_fps_unsupported",
2222
+ "video_fps_too_low",
2223
+ "video_aspect_unsupported",
2224
+ "video_duration_too_short",
2225
+ "video_duration_exceeds_max",
2226
+ "video_transform_failed",
2227
+ "media_fetch_failed",
2228
+ "document_format_unsupported",
2229
+ "document_too_large",
2230
+ "document_too_many_pages",
2231
+ "media_format_indeterminate",
2232
+ "media_format_unsupported",
2233
+ "media_count_invalid",
2234
+ "body_too_long",
2235
+ "content_missing",
2236
+ "content_conflict",
2237
+ "content_incomplete",
2238
+ "media_type_mismatch",
2239
+ "tag_limit_exceeded",
2240
+ "reel_field_on_non_reel",
2241
+ "field_placement_invalid",
2242
+ "title_too_long",
2243
+ "characters_not_allowed",
2244
+ "media_not_ready",
2245
+ "media_failed",
2246
+ "media_unsupported",
2247
+ "media_kind_mismatch",
2248
+ "variant_unparseable",
2249
+ "publishing_unavailable",
2250
+ "x_duplicate_content",
2251
+ "x_not_authorized",
2252
+ "x_access_not_permitted",
2253
+ "x_rate_limited",
2254
+ "x_publish_failed",
2255
+ "x_media_upload_failed",
2256
+ "x_thread_incomplete",
2257
+ "linkedin_duplicate_content",
2258
+ "linkedin_auth_expired",
2259
+ "linkedin_permission_denied",
2260
+ "linkedin_rate_limited",
2261
+ "linkedin_media_processing",
2262
+ "linkedin_media_failed",
2263
+ "linkedin_media_upload_failed",
2264
+ "linkedin_publish_failed",
2265
+ "instagram_media_processing",
2266
+ "instagram_container_expired",
2267
+ "instagram_container_failed",
2268
+ "instagram_rate_limited",
2269
+ "instagram_daily_limit_reached",
2270
+ "instagram_aspect_ratio_unsupported",
2271
+ "instagram_media_unsupported",
2272
+ "instagram_not_authorized",
2273
+ "instagram_publish_failed",
2274
+ "instagram_comment_failed",
2275
+ "facebook_reel_processing",
2276
+ "facebook_reel_failed",
2277
+ "facebook_rate_limited",
2278
+ "facebook_duplicate_content",
2279
+ "facebook_temporarily_blocked",
2280
+ "facebook_not_authorized",
2281
+ "facebook_publish_failed",
2282
+ "facebook_comment_failed",
2283
+ "tiktok_privacy_not_allowed",
2284
+ "tiktok_interaction_not_allowed",
2285
+ "tiktok_thumbnail_offset_invalid",
2286
+ "tiktok_duration_exceeds_max",
2287
+ "tiktok_media_processing",
2288
+ "tiktok_not_authorized",
2289
+ "tiktok_rate_limited",
2290
+ "tiktok_spam_risk",
2291
+ "tiktok_file_format_invalid",
2292
+ "tiktok_duration_invalid",
2293
+ "tiktok_frame_rate_invalid",
2294
+ "tiktok_resolution_invalid",
2295
+ "tiktok_media_pull_failed",
2296
+ "tiktok_server_error",
2297
+ "tiktok_publish_failed",
2298
+ "youtube_long_upload_not_allowed",
2299
+ "youtube_not_authorized",
2300
+ "youtube_daily_limit_reached",
2301
+ "youtube_upload_failed",
2302
+ "youtube_upload_unconfirmed",
2303
+ "youtube_video_rejected",
2304
+ "youtube_processing_failed",
2305
+ "youtube_thumbnail_failed",
2306
+ "post_publish_failed",
2307
+ "post_partially_published",
2308
+ "connection_platform_mismatch",
2309
+ "connection_removed",
2310
+ "publish_interrupted",
2311
+ "publish_outcome_unknown",
2312
+ "plan_limit_reached",
2313
+ "billing_required",
2314
+ "x_link_requires_paid_plan",
2315
+ "analytics_not_supported",
2316
+ "analytics_no_data"
2317
+ ]),
2318
+ message: z__namespace.string(),
2319
+ source: zErrorSource.optional(),
2320
+ display_error: z__namespace.string()
2321
+ }).nullable(),
2322
+ media: z__namespace.array(z__namespace.object({
2323
+ media_id: z__namespace.string(),
2324
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2325
+ alt_text_override: z__namespace.string().nullable(),
2326
+ media: zMedia
2327
+ }))
2328
+ }),
2329
+ z__namespace.object({
2330
+ platform: z__namespace.literal("youtube"),
2331
+ settings: zYouTubePostSettings,
2332
+ id: z__namespace.string(),
2333
+ object: z__namespace.literal("post_variant"),
2334
+ post_type: zPostType.nullable(),
2335
+ connection_id: z__namespace.string().nullable(),
2336
+ body: z__namespace.string().nullable(),
2337
+ status: zPostVariantStatus,
2338
+ schedule_at: z__namespace.string().nullable(),
2339
+ result: z__namespace.object({
2340
+ platform_post_id: z__namespace.string(),
2341
+ permalink: z__namespace.string().nullable(),
2342
+ published_at: z__namespace.string()
2343
+ }).nullable(),
2344
+ error: z__namespace.object({
2345
+ code: z__namespace.enum([
2346
+ "unauthorized",
2347
+ "forbidden",
2348
+ "not_found",
2349
+ "conflict",
2350
+ "validation_failed",
2351
+ "rate_limited",
2352
+ "internal_error",
2353
+ "idempotency_key_invalid",
2354
+ "idempotency_key_reused",
2355
+ "idempotency_request_in_progress",
2356
+ "account_not_available",
2357
+ "connection_reauth_required",
2358
+ "connection_not_pending",
2359
+ "not_implemented",
2360
+ "connection_discovery_failed",
2361
+ "tiktok_creator_info_unavailable",
2362
+ "tiktok_analytics_unavailable",
2363
+ "instagram_analytics_unavailable",
2364
+ "facebook_analytics_unavailable",
1962
2365
  "media_processing",
1963
2366
  "media_upload_init_failed",
1964
2367
  "media_upload_incomplete",
@@ -2003,6 +2406,8 @@ var zPostVariant = z__namespace.union([
2003
2406
  "tag_limit_exceeded",
2004
2407
  "reel_field_on_non_reel",
2005
2408
  "field_placement_invalid",
2409
+ "title_too_long",
2410
+ "characters_not_allowed",
2006
2411
  "media_not_ready",
2007
2412
  "media_failed",
2008
2413
  "media_unsupported",
@@ -2057,6 +2462,14 @@ var zPostVariant = z__namespace.union([
2057
2462
  "tiktok_media_pull_failed",
2058
2463
  "tiktok_server_error",
2059
2464
  "tiktok_publish_failed",
2465
+ "youtube_long_upload_not_allowed",
2466
+ "youtube_not_authorized",
2467
+ "youtube_daily_limit_reached",
2468
+ "youtube_upload_failed",
2469
+ "youtube_upload_unconfirmed",
2470
+ "youtube_video_rejected",
2471
+ "youtube_processing_failed",
2472
+ "youtube_thumbnail_failed",
2060
2473
  "post_publish_failed",
2061
2474
  "post_partially_published",
2062
2475
  "connection_platform_mismatch",
@@ -2065,7 +2478,9 @@ var zPostVariant = z__namespace.union([
2065
2478
  "publish_outcome_unknown",
2066
2479
  "plan_limit_reached",
2067
2480
  "billing_required",
2068
- "x_link_requires_paid_plan"
2481
+ "x_link_requires_paid_plan",
2482
+ "analytics_not_supported",
2483
+ "analytics_no_data"
2069
2484
  ]),
2070
2485
  message: z__namespace.string(),
2071
2486
  source: zErrorSource.optional(),
@@ -2288,6 +2703,16 @@ var zPostVariantInput = z__namespace.union([
2288
2703
  media_id: z__namespace.string(),
2289
2704
  alt_text_override: z__namespace.string().nullish()
2290
2705
  })).optional().default([])
2706
+ }),
2707
+ z__namespace.object({
2708
+ platform: z__namespace.literal("youtube"),
2709
+ settings: zYouTubePostSettings.optional().default({}),
2710
+ connection_id: z__namespace.string(),
2711
+ body: z__namespace.string().optional(),
2712
+ media: z__namespace.array(z__namespace.object({
2713
+ media_id: z__namespace.string(),
2714
+ alt_text_override: z__namespace.string().nullish()
2715
+ })).optional().default([])
2291
2716
  })
2292
2717
  ]);
2293
2718
  z__namespace.object({
@@ -2419,7 +2844,8 @@ z__namespace.object({
2419
2844
  "linkedin",
2420
2845
  "facebook_page",
2421
2846
  "instagram",
2422
- "tiktok"
2847
+ "tiktok",
2848
+ "youtube"
2423
2849
  ])
2424
2850
  });
2425
2851
  z__namespace.object({
@@ -2428,6 +2854,9 @@ z__namespace.object({
2428
2854
  z__namespace.object({
2429
2855
  id: z__namespace.string()
2430
2856
  });
2857
+ z__namespace.object({
2858
+ id: z__namespace.string()
2859
+ });
2431
2860
  z__namespace.object({
2432
2861
  limit: z__namespace.int().gte(1).lte(100).optional().default(20),
2433
2862
  offset: z__namespace.int().gte(0).lte(9007199254740991).optional().default(0),
@@ -2772,6 +3201,9 @@ z__namespace.object({
2772
3201
  "not_implemented",
2773
3202
  "connection_discovery_failed",
2774
3203
  "tiktok_creator_info_unavailable",
3204
+ "tiktok_analytics_unavailable",
3205
+ "instagram_analytics_unavailable",
3206
+ "facebook_analytics_unavailable",
2775
3207
  "media_processing",
2776
3208
  "media_upload_init_failed",
2777
3209
  "media_upload_incomplete",
@@ -2816,6 +3248,8 @@ z__namespace.object({
2816
3248
  "tag_limit_exceeded",
2817
3249
  "reel_field_on_non_reel",
2818
3250
  "field_placement_invalid",
3251
+ "title_too_long",
3252
+ "characters_not_allowed",
2819
3253
  "media_not_ready",
2820
3254
  "media_failed",
2821
3255
  "media_unsupported",
@@ -2870,6 +3304,14 @@ z__namespace.object({
2870
3304
  "tiktok_media_pull_failed",
2871
3305
  "tiktok_server_error",
2872
3306
  "tiktok_publish_failed",
3307
+ "youtube_long_upload_not_allowed",
3308
+ "youtube_not_authorized",
3309
+ "youtube_daily_limit_reached",
3310
+ "youtube_upload_failed",
3311
+ "youtube_upload_unconfirmed",
3312
+ "youtube_video_rejected",
3313
+ "youtube_processing_failed",
3314
+ "youtube_thumbnail_failed",
2873
3315
  "post_publish_failed",
2874
3316
  "post_partially_published",
2875
3317
  "connection_platform_mismatch",
@@ -2878,7 +3320,9 @@ z__namespace.object({
2878
3320
  "publish_outcome_unknown",
2879
3321
  "plan_limit_reached",
2880
3322
  "billing_required",
2881
- "x_link_requires_paid_plan"
3323
+ "x_link_requires_paid_plan",
3324
+ "analytics_not_supported",
3325
+ "analytics_no_data"
2882
3326
  ]),
2883
3327
  message: z__namespace.string(),
2884
3328
  hint: z__namespace.string().optional(),
@@ -2894,6 +3338,9 @@ z__namespace.object({
2894
3338
  z__namespace.object({
2895
3339
  id: z__namespace.string()
2896
3340
  });
3341
+ z__namespace.object({
3342
+ id: z__namespace.string()
3343
+ });
2897
3344
  z__namespace.object({
2898
3345
  limit: z__namespace.int().gte(1).lte(100).optional().default(20),
2899
3346
  offset: z__namespace.int().gte(0).lte(9007199254740991).optional().default(0),
@@ -2907,7 +3354,8 @@ z__namespace.object({
2907
3354
  "linkedin",
2908
3355
  "facebook_page",
2909
3356
  "instagram",
2910
- "tiktok"
3357
+ "tiktok",
3358
+ "youtube"
2911
3359
  ]).optional(),
2912
3360
  status: z__namespace.enum([
2913
3361
  "pending",
@@ -2949,7 +3397,8 @@ z__namespace.object({
2949
3397
  "linkedin",
2950
3398
  "facebook_page",
2951
3399
  "instagram",
2952
- "tiktok"
3400
+ "tiktok",
3401
+ "youtube"
2953
3402
  ]).nullable(),
2954
3403
  request_method: z__namespace.string().nullable(),
2955
3404
  request_path: z__namespace.string().nullable(),
@@ -2973,6 +3422,9 @@ z__namespace.object({
2973
3422
  "not_implemented",
2974
3423
  "connection_discovery_failed",
2975
3424
  "tiktok_creator_info_unavailable",
3425
+ "tiktok_analytics_unavailable",
3426
+ "instagram_analytics_unavailable",
3427
+ "facebook_analytics_unavailable",
2976
3428
  "media_processing",
2977
3429
  "media_upload_init_failed",
2978
3430
  "media_upload_incomplete",
@@ -3017,6 +3469,8 @@ z__namespace.object({
3017
3469
  "tag_limit_exceeded",
3018
3470
  "reel_field_on_non_reel",
3019
3471
  "field_placement_invalid",
3472
+ "title_too_long",
3473
+ "characters_not_allowed",
3020
3474
  "media_not_ready",
3021
3475
  "media_failed",
3022
3476
  "media_unsupported",
@@ -3071,6 +3525,14 @@ z__namespace.object({
3071
3525
  "tiktok_media_pull_failed",
3072
3526
  "tiktok_server_error",
3073
3527
  "tiktok_publish_failed",
3528
+ "youtube_long_upload_not_allowed",
3529
+ "youtube_not_authorized",
3530
+ "youtube_daily_limit_reached",
3531
+ "youtube_upload_failed",
3532
+ "youtube_upload_unconfirmed",
3533
+ "youtube_video_rejected",
3534
+ "youtube_processing_failed",
3535
+ "youtube_thumbnail_failed",
3074
3536
  "post_publish_failed",
3075
3537
  "post_partially_published",
3076
3538
  "connection_platform_mismatch",
@@ -3079,7 +3541,9 @@ z__namespace.object({
3079
3541
  "publish_outcome_unknown",
3080
3542
  "plan_limit_reached",
3081
3543
  "billing_required",
3082
- "x_link_requires_paid_plan"
3544
+ "x_link_requires_paid_plan",
3545
+ "analytics_not_supported",
3546
+ "analytics_no_data"
3083
3547
  ]),
3084
3548
  message: z__namespace.string()
3085
3549
  }).nullable(),
@@ -3100,7 +3564,8 @@ z__namespace.object({
3100
3564
  "linkedin",
3101
3565
  "facebook_page",
3102
3566
  "instagram",
3103
- "tiktok"
3567
+ "tiktok",
3568
+ "youtube"
3104
3569
  ]),
3105
3570
  status: z__namespace.enum([
3106
3571
  "draft",
@@ -3130,6 +3595,9 @@ z__namespace.object({
3130
3595
  "not_implemented",
3131
3596
  "connection_discovery_failed",
3132
3597
  "tiktok_creator_info_unavailable",
3598
+ "tiktok_analytics_unavailable",
3599
+ "instagram_analytics_unavailable",
3600
+ "facebook_analytics_unavailable",
3133
3601
  "media_processing",
3134
3602
  "media_upload_init_failed",
3135
3603
  "media_upload_incomplete",
@@ -3174,6 +3642,8 @@ z__namespace.object({
3174
3642
  "tag_limit_exceeded",
3175
3643
  "reel_field_on_non_reel",
3176
3644
  "field_placement_invalid",
3645
+ "title_too_long",
3646
+ "characters_not_allowed",
3177
3647
  "media_not_ready",
3178
3648
  "media_failed",
3179
3649
  "media_unsupported",
@@ -3228,6 +3698,14 @@ z__namespace.object({
3228
3698
  "tiktok_media_pull_failed",
3229
3699
  "tiktok_server_error",
3230
3700
  "tiktok_publish_failed",
3701
+ "youtube_long_upload_not_allowed",
3702
+ "youtube_not_authorized",
3703
+ "youtube_daily_limit_reached",
3704
+ "youtube_upload_failed",
3705
+ "youtube_upload_unconfirmed",
3706
+ "youtube_video_rejected",
3707
+ "youtube_processing_failed",
3708
+ "youtube_thumbnail_failed",
3231
3709
  "post_publish_failed",
3232
3710
  "post_partially_published",
3233
3711
  "connection_platform_mismatch",
@@ -3236,7 +3714,9 @@ z__namespace.object({
3236
3714
  "publish_outcome_unknown",
3237
3715
  "plan_limit_reached",
3238
3716
  "billing_required",
3239
- "x_link_requires_paid_plan"
3717
+ "x_link_requires_paid_plan",
3718
+ "analytics_not_supported",
3719
+ "analytics_no_data"
3240
3720
  ]),
3241
3721
  message: z__namespace.string(),
3242
3722
  source: zErrorSource.optional(),
@@ -3260,6 +3740,9 @@ z__namespace.object({
3260
3740
  "not_implemented",
3261
3741
  "connection_discovery_failed",
3262
3742
  "tiktok_creator_info_unavailable",
3743
+ "tiktok_analytics_unavailable",
3744
+ "instagram_analytics_unavailable",
3745
+ "facebook_analytics_unavailable",
3263
3746
  "media_processing",
3264
3747
  "media_upload_init_failed",
3265
3748
  "media_upload_incomplete",
@@ -3304,6 +3787,8 @@ z__namespace.object({
3304
3787
  "tag_limit_exceeded",
3305
3788
  "reel_field_on_non_reel",
3306
3789
  "field_placement_invalid",
3790
+ "title_too_long",
3791
+ "characters_not_allowed",
3307
3792
  "media_not_ready",
3308
3793
  "media_failed",
3309
3794
  "media_unsupported",
@@ -3358,6 +3843,14 @@ z__namespace.object({
3358
3843
  "tiktok_media_pull_failed",
3359
3844
  "tiktok_server_error",
3360
3845
  "tiktok_publish_failed",
3846
+ "youtube_long_upload_not_allowed",
3847
+ "youtube_not_authorized",
3848
+ "youtube_daily_limit_reached",
3849
+ "youtube_upload_failed",
3850
+ "youtube_upload_unconfirmed",
3851
+ "youtube_video_rejected",
3852
+ "youtube_processing_failed",
3853
+ "youtube_thumbnail_failed",
3361
3854
  "post_publish_failed",
3362
3855
  "post_partially_published",
3363
3856
  "connection_platform_mismatch",
@@ -3366,7 +3859,9 @@ z__namespace.object({
3366
3859
  "publish_outcome_unknown",
3367
3860
  "plan_limit_reached",
3368
3861
  "billing_required",
3369
- "x_link_requires_paid_plan"
3862
+ "x_link_requires_paid_plan",
3863
+ "analytics_not_supported",
3864
+ "analytics_no_data"
3370
3865
  ]),
3371
3866
  message: z__namespace.string(),
3372
3867
  source: zErrorSource.optional(),
@@ -3415,7 +3910,8 @@ z__namespace.object({
3415
3910
  "linkedin",
3416
3911
  "facebook_page",
3417
3912
  "instagram",
3418
- "tiktok"
3913
+ "tiktok",
3914
+ "youtube"
3419
3915
  ]).nullable(),
3420
3916
  request_method: z__namespace.string().nullable(),
3421
3917
  request_path: z__namespace.string().nullable(),
@@ -3439,6 +3935,9 @@ z__namespace.object({
3439
3935
  "not_implemented",
3440
3936
  "connection_discovery_failed",
3441
3937
  "tiktok_creator_info_unavailable",
3938
+ "tiktok_analytics_unavailable",
3939
+ "instagram_analytics_unavailable",
3940
+ "facebook_analytics_unavailable",
3442
3941
  "media_processing",
3443
3942
  "media_upload_init_failed",
3444
3943
  "media_upload_incomplete",
@@ -3483,6 +3982,8 @@ z__namespace.object({
3483
3982
  "tag_limit_exceeded",
3484
3983
  "reel_field_on_non_reel",
3485
3984
  "field_placement_invalid",
3985
+ "title_too_long",
3986
+ "characters_not_allowed",
3486
3987
  "media_not_ready",
3487
3988
  "media_failed",
3488
3989
  "media_unsupported",
@@ -3537,6 +4038,14 @@ z__namespace.object({
3537
4038
  "tiktok_media_pull_failed",
3538
4039
  "tiktok_server_error",
3539
4040
  "tiktok_publish_failed",
4041
+ "youtube_long_upload_not_allowed",
4042
+ "youtube_not_authorized",
4043
+ "youtube_daily_limit_reached",
4044
+ "youtube_upload_failed",
4045
+ "youtube_upload_unconfirmed",
4046
+ "youtube_video_rejected",
4047
+ "youtube_processing_failed",
4048
+ "youtube_thumbnail_failed",
3540
4049
  "post_publish_failed",
3541
4050
  "post_partially_published",
3542
4051
  "connection_platform_mismatch",
@@ -3545,7 +4054,9 @@ z__namespace.object({
3545
4054
  "publish_outcome_unknown",
3546
4055
  "plan_limit_reached",
3547
4056
  "billing_required",
3548
- "x_link_requires_paid_plan"
4057
+ "x_link_requires_paid_plan",
4058
+ "analytics_not_supported",
4059
+ "analytics_no_data"
3549
4060
  ]),
3550
4061
  message: z__namespace.string()
3551
4062
  }).nullable(),
@@ -3566,7 +4077,8 @@ z__namespace.object({
3566
4077
  "linkedin",
3567
4078
  "facebook_page",
3568
4079
  "instagram",
3569
- "tiktok"
4080
+ "tiktok",
4081
+ "youtube"
3570
4082
  ]),
3571
4083
  status: z__namespace.enum([
3572
4084
  "draft",
@@ -3596,6 +4108,9 @@ z__namespace.object({
3596
4108
  "not_implemented",
3597
4109
  "connection_discovery_failed",
3598
4110
  "tiktok_creator_info_unavailable",
4111
+ "tiktok_analytics_unavailable",
4112
+ "instagram_analytics_unavailable",
4113
+ "facebook_analytics_unavailable",
3599
4114
  "media_processing",
3600
4115
  "media_upload_init_failed",
3601
4116
  "media_upload_incomplete",
@@ -3640,6 +4155,8 @@ z__namespace.object({
3640
4155
  "tag_limit_exceeded",
3641
4156
  "reel_field_on_non_reel",
3642
4157
  "field_placement_invalid",
4158
+ "title_too_long",
4159
+ "characters_not_allowed",
3643
4160
  "media_not_ready",
3644
4161
  "media_failed",
3645
4162
  "media_unsupported",
@@ -3694,6 +4211,14 @@ z__namespace.object({
3694
4211
  "tiktok_media_pull_failed",
3695
4212
  "tiktok_server_error",
3696
4213
  "tiktok_publish_failed",
4214
+ "youtube_long_upload_not_allowed",
4215
+ "youtube_not_authorized",
4216
+ "youtube_daily_limit_reached",
4217
+ "youtube_upload_failed",
4218
+ "youtube_upload_unconfirmed",
4219
+ "youtube_video_rejected",
4220
+ "youtube_processing_failed",
4221
+ "youtube_thumbnail_failed",
3697
4222
  "post_publish_failed",
3698
4223
  "post_partially_published",
3699
4224
  "connection_platform_mismatch",
@@ -3702,7 +4227,9 @@ z__namespace.object({
3702
4227
  "publish_outcome_unknown",
3703
4228
  "plan_limit_reached",
3704
4229
  "billing_required",
3705
- "x_link_requires_paid_plan"
4230
+ "x_link_requires_paid_plan",
4231
+ "analytics_not_supported",
4232
+ "analytics_no_data"
3706
4233
  ]),
3707
4234
  message: z__namespace.string(),
3708
4235
  source: zErrorSource.optional(),
@@ -3726,6 +4253,9 @@ z__namespace.object({
3726
4253
  "not_implemented",
3727
4254
  "connection_discovery_failed",
3728
4255
  "tiktok_creator_info_unavailable",
4256
+ "tiktok_analytics_unavailable",
4257
+ "instagram_analytics_unavailable",
4258
+ "facebook_analytics_unavailable",
3729
4259
  "media_processing",
3730
4260
  "media_upload_init_failed",
3731
4261
  "media_upload_incomplete",
@@ -3770,6 +4300,8 @@ z__namespace.object({
3770
4300
  "tag_limit_exceeded",
3771
4301
  "reel_field_on_non_reel",
3772
4302
  "field_placement_invalid",
4303
+ "title_too_long",
4304
+ "characters_not_allowed",
3773
4305
  "media_not_ready",
3774
4306
  "media_failed",
3775
4307
  "media_unsupported",
@@ -3824,6 +4356,14 @@ z__namespace.object({
3824
4356
  "tiktok_media_pull_failed",
3825
4357
  "tiktok_server_error",
3826
4358
  "tiktok_publish_failed",
4359
+ "youtube_long_upload_not_allowed",
4360
+ "youtube_not_authorized",
4361
+ "youtube_daily_limit_reached",
4362
+ "youtube_upload_failed",
4363
+ "youtube_upload_unconfirmed",
4364
+ "youtube_video_rejected",
4365
+ "youtube_processing_failed",
4366
+ "youtube_thumbnail_failed",
3827
4367
  "post_publish_failed",
3828
4368
  "post_partially_published",
3829
4369
  "connection_platform_mismatch",
@@ -3832,7 +4372,9 @@ z__namespace.object({
3832
4372
  "publish_outcome_unknown",
3833
4373
  "plan_limit_reached",
3834
4374
  "billing_required",
3835
- "x_link_requires_paid_plan"
4375
+ "x_link_requires_paid_plan",
4376
+ "analytics_not_supported",
4377
+ "analytics_no_data"
3836
4378
  ]),
3837
4379
  message: z__namespace.string(),
3838
4380
  source: zErrorSource.optional(),
@@ -4275,6 +4817,19 @@ var connectionsConnect = (options) => (options.client ?? client).post({
4275
4817
  ...options.headers
4276
4818
  }
4277
4819
  });
4820
+ var connectionsGetAnalytics = (options) => (options.client ?? client).get({
4821
+ security: [{
4822
+ key: "secretKey",
4823
+ scheme: "bearer",
4824
+ type: "http"
4825
+ }, {
4826
+ key: "frontendToken",
4827
+ scheme: "bearer",
4828
+ type: "http"
4829
+ }],
4830
+ url: "/connections/{id}/analytics",
4831
+ ...options
4832
+ });
4278
4833
  var mediaList = (options) => (options?.client ?? client).get({
4279
4834
  security: [{
4280
4835
  key: "secretKey",
@@ -4515,6 +5070,19 @@ var postsValidate = (options) => (options.client ?? client).post({
4515
5070
  ...options.headers
4516
5071
  }
4517
5072
  });
5073
+ var postsGetAnalytics = (options) => (options.client ?? client).get({
5074
+ security: [{
5075
+ key: "secretKey",
5076
+ scheme: "bearer",
5077
+ type: "http"
5078
+ }, {
5079
+ key: "frontendToken",
5080
+ scheme: "bearer",
5081
+ type: "http"
5082
+ }],
5083
+ url: "/posts/{id}/analytics",
5084
+ ...options
5085
+ });
4518
5086
  var tiktokCreatorInfo = (options) => (options.client ?? client).get({
4519
5087
  security: [{
4520
5088
  key: "secretKey",
@@ -4810,8 +5378,8 @@ function linkedinPollDurationLabel(value) {
4810
5378
  }
4811
5379
 
4812
5380
  // src/x.ts
4813
- function plural(n, unit) {
4814
- return `${n} ${unit}${n === 1 ? "" : "s"} left`;
5381
+ function plural(n, unit2) {
5382
+ return `${n} ${unit2}${n === 1 ? "" : "s"} left`;
4815
5383
  }
4816
5384
  function xPollDurationLabel(durationMinutes) {
4817
5385
  if (durationMinutes >= 1440) {
@@ -4823,6 +5391,212 @@ function xPollDurationLabel(durationMinutes) {
4823
5391
  return plural(durationMinutes, "minute");
4824
5392
  }
4825
5393
 
5394
+ // src/analytics.ts
5395
+ var ANALYTICS_PLATFORMS = [
5396
+ "tiktok",
5397
+ "instagram",
5398
+ "facebook_page"
5399
+ ];
5400
+ function hasAnalytics(platform) {
5401
+ return ANALYTICS_PLATFORMS.some((supported) => supported === platform);
5402
+ }
5403
+ function hasPostAnalytics(variant) {
5404
+ return variant.status === "published" && hasAnalytics(variant.platform);
5405
+ }
5406
+ var TIKTOK_POST = [
5407
+ { key: "video_views", label: "Views" },
5408
+ { key: "reach", label: "Reach" },
5409
+ { key: "likes", label: "Likes" },
5410
+ { key: "comments", label: "Comments" },
5411
+ { key: "shares", label: "Shares" },
5412
+ { key: "favorites", label: "Saves" },
5413
+ { key: "average_time_watched", label: "Avg. watch time", format: "seconds" },
5414
+ { key: "full_video_watched_rate", label: "Completion", format: "ratio" },
5415
+ { key: "new_followers", label: "New followers" },
5416
+ { key: "profile_views", label: "Profile views" }
5417
+ ];
5418
+ var INSTAGRAM_SHARED = [
5419
+ { key: "views", label: "Views" },
5420
+ { key: "reach", label: "Reach" },
5421
+ { key: "likes", label: "Likes" },
5422
+ { key: "comments", label: "Comments" },
5423
+ { key: "shares", label: "Shares" },
5424
+ { key: "saved", label: "Saves" },
5425
+ { key: "reposts", label: "Reposts" },
5426
+ { key: "total_interactions", label: "Interactions" }
5427
+ ];
5428
+ var INSTAGRAM_FEED = [
5429
+ ...INSTAGRAM_SHARED,
5430
+ { key: "follows", label: "Follows" },
5431
+ { key: "profile_visits", label: "Profile visits" },
5432
+ { key: "profile_activity", label: "Profile activity" }
5433
+ ];
5434
+ var INSTAGRAM_REEL = [
5435
+ ...INSTAGRAM_SHARED,
5436
+ {
5437
+ key: "ig_reels_avg_watch_time",
5438
+ label: "Avg. watch time",
5439
+ format: "milliseconds"
5440
+ },
5441
+ {
5442
+ key: "ig_reels_video_view_total_time",
5443
+ label: "Watch time",
5444
+ format: "milliseconds"
5445
+ },
5446
+ { key: "reels_skip_rate", label: "Skip rate", format: "percent" }
5447
+ ];
5448
+ var FACEBOOK_FEED = [
5449
+ { key: "post_media_view", label: "Views" },
5450
+ { key: "post_total_media_view_unique", label: "Viewers" },
5451
+ { key: "post_reactions_by_type_total", label: "Reactions" },
5452
+ { key: "post_clicks", label: "Clicks" },
5453
+ { key: "post_clicks_by_type", label: "Clicks by type" },
5454
+ { key: "comments", label: "Comments" },
5455
+ { key: "shares", label: "Shares" }
5456
+ ];
5457
+ var FACEBOOK_REEL = [
5458
+ { key: "blue_reels_play_count", label: "Plays" },
5459
+ { key: "fb_reels_total_plays", label: "Total plays" },
5460
+ { key: "fb_reels_replay_count", label: "Replays" },
5461
+ {
5462
+ key: "post_video_avg_time_watched",
5463
+ label: "Avg. watch time",
5464
+ format: "milliseconds"
5465
+ },
5466
+ { key: "post_video_view_time", label: "Watch time", format: "milliseconds" },
5467
+ { key: "post_video_followers", label: "New followers" },
5468
+ { key: "post_video_likes_by_reaction_type", label: "Reactions" }
5469
+ ];
5470
+ function rowsOf(fields, metrics) {
5471
+ return fields.map(({ key, label, format = "count" }) => ({
5472
+ key,
5473
+ label,
5474
+ format,
5475
+ value: metrics[key]
5476
+ }));
5477
+ }
5478
+ function postMetricRows(metrics, postType) {
5479
+ switch (metrics.platform) {
5480
+ case "tiktok":
5481
+ return rowsOf(TIKTOK_POST, metrics);
5482
+ case "instagram":
5483
+ return rowsOf(
5484
+ postType === "reel" ? INSTAGRAM_REEL : INSTAGRAM_FEED,
5485
+ metrics
5486
+ );
5487
+ case "facebook_page":
5488
+ return rowsOf(
5489
+ postType === "reel" ? FACEBOOK_REEL : FACEBOOK_FEED,
5490
+ metrics
5491
+ );
5492
+ }
5493
+ }
5494
+ var TIKTOK_ACCOUNT = [
5495
+ { key: "followers_count", label: "Followers" },
5496
+ { key: "following_count", label: "Following" },
5497
+ { key: "total_likes", label: "Likes" },
5498
+ { key: "videos_count", label: "Videos" }
5499
+ ];
5500
+ var INSTAGRAM_ACCOUNT = [
5501
+ { key: "followers_count", label: "Followers" },
5502
+ { key: "follows_count", label: "Following" },
5503
+ { key: "media_count", label: "Posts" }
5504
+ ];
5505
+ var INSTAGRAM_LAST_30_DAYS = [
5506
+ { key: "views", label: "Views \xB7 30d" },
5507
+ { key: "reach", label: "Reach \xB7 30d" },
5508
+ { key: "accounts_engaged", label: "Engaged \xB7 30d" },
5509
+ { key: "total_interactions", label: "Interactions \xB7 30d" }
5510
+ ];
5511
+ var FACEBOOK_ACCOUNT = [
5512
+ { key: "followers_count", label: "Followers" }
5513
+ ];
5514
+ function accountMetricRows(metrics) {
5515
+ switch (metrics.platform) {
5516
+ case "tiktok":
5517
+ return rowsOf(TIKTOK_ACCOUNT, metrics);
5518
+ case "instagram":
5519
+ return [
5520
+ ...rowsOf(INSTAGRAM_ACCOUNT, metrics),
5521
+ ...rowsOf(INSTAGRAM_LAST_30_DAYS, metrics.last_30_days)
5522
+ ];
5523
+ case "facebook_page":
5524
+ return rowsOf(FACEBOOK_ACCOUNT, metrics);
5525
+ }
5526
+ }
5527
+ function pointsOf(daily, key) {
5528
+ return daily.flatMap((day) => {
5529
+ const value = day[key];
5530
+ return value === null ? [] : [{ date: day.date, value }];
5531
+ });
5532
+ }
5533
+ function accountTrend(metrics) {
5534
+ switch (metrics.platform) {
5535
+ case "tiktok":
5536
+ return {
5537
+ label: "Followers",
5538
+ points: pointsOf(metrics.daily, "followers_count")
5539
+ };
5540
+ case "instagram":
5541
+ return { label: "Reach", points: pointsOf(metrics.daily, "reach") };
5542
+ case "facebook_page":
5543
+ return {
5544
+ label: "Followers",
5545
+ points: pointsOf(metrics.daily, "page_follows")
5546
+ };
5547
+ }
5548
+ }
5549
+ var COUNT = new Intl.NumberFormat("en-US", {
5550
+ notation: "compact",
5551
+ maximumFractionDigits: 1
5552
+ });
5553
+ var PERCENT = new Intl.NumberFormat("en-US", {
5554
+ style: "percent",
5555
+ maximumFractionDigits: 1
5556
+ });
5557
+ var unit = (name) => new Intl.NumberFormat("en-US", {
5558
+ style: "unit",
5559
+ unit: name,
5560
+ unitDisplay: "narrow",
5561
+ maximumFractionDigits: 1
5562
+ });
5563
+ var SECONDS = unit("second");
5564
+ var MINUTES = unit("minute");
5565
+ var HOURS = unit("hour");
5566
+ var roundsBelow = (value, limit) => Math.round(value * 10) / 10 < limit;
5567
+ function formatDuration(seconds) {
5568
+ if (roundsBelow(seconds, 60)) {
5569
+ return SECONDS.format(seconds);
5570
+ }
5571
+ const minutes = seconds / 60;
5572
+ return roundsBelow(minutes, 60) ? MINUTES.format(minutes) : HOURS.format(minutes / 60);
5573
+ }
5574
+ function formatNumber(value, format) {
5575
+ switch (format) {
5576
+ case "count":
5577
+ return COUNT.format(value);
5578
+ case "seconds":
5579
+ return formatDuration(value);
5580
+ case "milliseconds":
5581
+ return formatDuration(value / 1e3);
5582
+ case "ratio":
5583
+ return PERCENT.format(value);
5584
+ case "percent":
5585
+ return PERCENT.format(value / 100);
5586
+ }
5587
+ }
5588
+ var capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
5589
+ function formatMetric(value, format = "count") {
5590
+ if (value === null) {
5591
+ return "\u2014";
5592
+ }
5593
+ if (typeof value === "number") {
5594
+ return formatNumber(value, format);
5595
+ }
5596
+ const entries = Object.entries(value).sort(([, a], [, b]) => b - a);
5597
+ return entries.length === 0 ? "0" : entries.map(([type, count]) => `${capitalize(type)} ${COUNT.format(count)}`).join(" \xB7 ");
5598
+ }
5599
+
4826
5600
  // src/tiktok-options.ts
4827
5601
  var TIKTOK_CAPTION_MAX = { video: 2200, photo: 4e3 };
4828
5602
  function captionMaxFor(postType) {
@@ -5020,12 +5794,22 @@ var tiktokHandler = {
5020
5794
  settings
5021
5795
  })
5022
5796
  };
5797
+ var youtubeHandler = {
5798
+ buildVariant: ({ settings, connectionId, body, media }) => ({
5799
+ platform: "youtube",
5800
+ connection_id: connectionId,
5801
+ body,
5802
+ media: [...media],
5803
+ settings
5804
+ })
5805
+ };
5023
5806
  var PLATFORM_HANDLERS = {
5024
5807
  x: xHandler,
5025
5808
  linkedin: linkedInHandler,
5026
5809
  facebook_page: facebookHandler,
5027
5810
  instagram: instagramHandler,
5028
- tiktok: tiktokHandler
5811
+ tiktok: tiktokHandler,
5812
+ youtube: youtubeHandler
5029
5813
  };
5030
5814
  function isPostPlatform(value) {
5031
5815
  return Object.prototype.hasOwnProperty.call(PLATFORM_HANDLERS, value);
@@ -5122,6 +5906,8 @@ exports.TIKTOK_DISCLOSURE_REQUIRED_HINT = TIKTOK_DISCLOSURE_REQUIRED_HINT;
5122
5906
  exports.TIKTOK_MUSIC_CONFIRMATION_URL = TIKTOK_MUSIC_CONFIRMATION_URL;
5123
5907
  exports.TIKTOK_PROCESSING_NOTICE = TIKTOK_PROCESSING_NOTICE;
5124
5908
  exports.UploadError = UploadError;
5909
+ exports.accountMetricRows = accountMetricRows;
5910
+ exports.accountTrend = accountTrend;
5125
5911
  exports.audiencePrivacyOptions = audiencePrivacyOptions;
5126
5912
  exports.audienceUnselected = audienceUnselected;
5127
5913
  exports.brandedContentDeclared = brandedContentDeclared;
@@ -5134,12 +5920,16 @@ exports.commercialLabelNotice = commercialLabelNotice;
5134
5920
  exports.connectionsConnect = connectionsConnect;
5135
5921
  exports.connectionsDelete = connectionsDelete;
5136
5922
  exports.connectionsGet = connectionsGet;
5923
+ exports.connectionsGetAnalytics = connectionsGetAnalytics;
5137
5924
  exports.connectionsListAccounts = connectionsListAccounts;
5138
5925
  exports.connectionsListByProfile = connectionsListByProfile;
5139
5926
  exports.connectionsSelect = connectionsSelect;
5140
5927
  exports.createPostrunClient = createPostrunClient;
5141
5928
  exports.defaultTikTokOptions = defaultTikTokOptions;
5142
5929
  exports.failedVariants = failedVariants;
5930
+ exports.formatMetric = formatMetric;
5931
+ exports.hasAnalytics = hasAnalytics;
5932
+ exports.hasPostAnalytics = hasPostAnalytics;
5143
5933
  exports.interactionRows = interactionRows;
5144
5934
  exports.interactionValueKey = interactionValueKey;
5145
5935
  exports.isInteractionForbidden = isInteractionForbidden;
@@ -5158,9 +5948,11 @@ exports.mediaListParts = mediaListParts;
5158
5948
  exports.mediaSignPart = mediaSignPart;
5159
5949
  exports.mediaUpdate = mediaUpdate;
5160
5950
  exports.parsePrivacyLevel = parsePrivacyLevel;
5951
+ exports.postMetricRows = postMetricRows;
5161
5952
  exports.postsCreate = postsCreate;
5162
5953
  exports.postsDelete = postsDelete;
5163
5954
  exports.postsGet = postsGet;
5955
+ exports.postsGetAnalytics = postsGetAnalytics;
5164
5956
  exports.postsList = postsList;
5165
5957
  exports.postsRetry = postsRetry;
5166
5958
  exports.postsUpdate = postsUpdate;