@postrun/js 2.2.1 → 2.4.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/{chunk-YVCFLH5K.js → chunk-IK4QXQLM.js} +3 -3
- package/dist/{chunk-YVCFLH5K.js.map → chunk-IK4QXQLM.js.map} +1 -1
- package/dist/{chunk-GOQVIAPL.js → chunk-LATXGVUG.js} +68 -28
- package/dist/chunk-LATXGVUG.js.map +1 -0
- package/dist/index.cjs +209 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +143 -3
- package/dist/index.d.ts +143 -3
- package/dist/index.js +123 -3
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +66 -26
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +48 -8
- package/dist/schemas/index.d.ts +48 -8
- package/dist/schemas/index.js +1 -1
- package/dist/server.cjs +66 -26
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -2
- package/dist/{types.gen-CzxuwPxe.d.cts → types.gen-BUi197pC.d.cts} +103 -31
- package/dist/{types.gen-CzxuwPxe.d.ts → types.gen-BUi197pC.d.ts} +103 -31
- package/package.json +1 -1
- package/dist/chunk-GOQVIAPL.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -844,6 +844,7 @@ var zErrorCode = z__namespace.enum([
|
|
|
844
844
|
"document_too_large",
|
|
845
845
|
"document_too_many_pages",
|
|
846
846
|
"media_format_indeterminate",
|
|
847
|
+
"media_format_unsupported",
|
|
847
848
|
"media_count_invalid",
|
|
848
849
|
"body_too_long",
|
|
849
850
|
"content_missing",
|
|
@@ -890,6 +891,9 @@ var zErrorCode = z__namespace.enum([
|
|
|
890
891
|
"tiktok_media_processing",
|
|
891
892
|
"tiktok_not_authorized",
|
|
892
893
|
"tiktok_rate_limited",
|
|
894
|
+
"tiktok_url_ownership_unverified",
|
|
895
|
+
"tiktok_unaudited_private_only",
|
|
896
|
+
"tiktok_spam_risk",
|
|
893
897
|
"tiktok_publish_failed",
|
|
894
898
|
"post_publish_failed",
|
|
895
899
|
"post_partially_published",
|
|
@@ -1152,6 +1156,7 @@ z__namespace.object({
|
|
|
1152
1156
|
"x",
|
|
1153
1157
|
"linkedin",
|
|
1154
1158
|
"facebook_page",
|
|
1159
|
+
"instagram",
|
|
1155
1160
|
"tiktok"
|
|
1156
1161
|
])
|
|
1157
1162
|
});
|
|
@@ -1222,6 +1227,7 @@ z__namespace.object({
|
|
|
1222
1227
|
code: z__namespace.enum([
|
|
1223
1228
|
"media_unprobeable",
|
|
1224
1229
|
"media_format_indeterminate",
|
|
1230
|
+
"media_format_unsupported",
|
|
1225
1231
|
"media_too_large",
|
|
1226
1232
|
"media_aspect_ratio_unsupported",
|
|
1227
1233
|
"media_resolution_too_low",
|
|
@@ -1250,7 +1256,8 @@ z__namespace.object({
|
|
|
1250
1256
|
message: z__namespace.string(),
|
|
1251
1257
|
hint: z__namespace.string().optional(),
|
|
1252
1258
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1253
|
-
got: z__namespace.string().optional()
|
|
1259
|
+
got: z__namespace.string().optional(),
|
|
1260
|
+
display_error: z__namespace.string()
|
|
1254
1261
|
}).nullable(),
|
|
1255
1262
|
source: z__namespace.object({
|
|
1256
1263
|
format: z__namespace.string(),
|
|
@@ -1274,6 +1281,7 @@ z__namespace.object({
|
|
|
1274
1281
|
code: z__namespace.enum([
|
|
1275
1282
|
"media_unprobeable",
|
|
1276
1283
|
"media_format_indeterminate",
|
|
1284
|
+
"media_format_unsupported",
|
|
1277
1285
|
"media_too_large",
|
|
1278
1286
|
"media_aspect_ratio_unsupported",
|
|
1279
1287
|
"media_resolution_too_low",
|
|
@@ -1302,12 +1310,14 @@ z__namespace.object({
|
|
|
1302
1310
|
message: z__namespace.string(),
|
|
1303
1311
|
hint: z__namespace.string().optional(),
|
|
1304
1312
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1305
|
-
got: z__namespace.string().optional()
|
|
1313
|
+
got: z__namespace.string().optional(),
|
|
1314
|
+
display_error: z__namespace.string()
|
|
1306
1315
|
})),
|
|
1307
1316
|
errors: z__namespace.array(z__namespace.object({
|
|
1308
1317
|
code: z__namespace.enum([
|
|
1309
1318
|
"media_unprobeable",
|
|
1310
1319
|
"media_format_indeterminate",
|
|
1320
|
+
"media_format_unsupported",
|
|
1311
1321
|
"media_too_large",
|
|
1312
1322
|
"media_aspect_ratio_unsupported",
|
|
1313
1323
|
"media_resolution_too_low",
|
|
@@ -1336,7 +1346,8 @@ z__namespace.object({
|
|
|
1336
1346
|
message: z__namespace.string(),
|
|
1337
1347
|
hint: z__namespace.string().optional(),
|
|
1338
1348
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1339
|
-
got: z__namespace.string().optional()
|
|
1349
|
+
got: z__namespace.string().optional(),
|
|
1350
|
+
display_error: z__namespace.string()
|
|
1340
1351
|
}))
|
|
1341
1352
|
})),
|
|
1342
1353
|
external_id: z__namespace.string().nullable(),
|
|
@@ -1355,13 +1366,6 @@ z__namespace.object({
|
|
|
1355
1366
|
});
|
|
1356
1367
|
z__namespace.object({
|
|
1357
1368
|
profile_id: z__namespace.string(),
|
|
1358
|
-
kind: z__namespace.enum([
|
|
1359
|
-
"image",
|
|
1360
|
-
"video",
|
|
1361
|
-
"gif",
|
|
1362
|
-
"document"
|
|
1363
|
-
]).optional(),
|
|
1364
|
-
content_type: z__namespace.string().min(1).regex(/^(?:(?:image|video)\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*|application\/pdf|application\/msword|application\/vnd\.openxmlformats-officedocument\.wordprocessingml\.document|application\/vnd\.ms-powerpoint|application\/vnd\.openxmlformats-officedocument\.presentationml\.presentation)$/).optional(),
|
|
1365
1369
|
source_url: z__namespace.url().optional(),
|
|
1366
1370
|
targets: z__namespace.array(z__namespace.enum([
|
|
1367
1371
|
"x",
|
|
@@ -1411,6 +1415,7 @@ z__namespace.object({
|
|
|
1411
1415
|
code: z__namespace.enum([
|
|
1412
1416
|
"media_unprobeable",
|
|
1413
1417
|
"media_format_indeterminate",
|
|
1418
|
+
"media_format_unsupported",
|
|
1414
1419
|
"media_too_large",
|
|
1415
1420
|
"media_aspect_ratio_unsupported",
|
|
1416
1421
|
"media_resolution_too_low",
|
|
@@ -1439,7 +1444,8 @@ z__namespace.object({
|
|
|
1439
1444
|
message: z__namespace.string(),
|
|
1440
1445
|
hint: z__namespace.string().optional(),
|
|
1441
1446
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1442
|
-
got: z__namespace.string().optional()
|
|
1447
|
+
got: z__namespace.string().optional(),
|
|
1448
|
+
display_error: z__namespace.string()
|
|
1443
1449
|
}).nullable(),
|
|
1444
1450
|
source: z__namespace.object({
|
|
1445
1451
|
format: z__namespace.string(),
|
|
@@ -1463,6 +1469,7 @@ z__namespace.object({
|
|
|
1463
1469
|
code: z__namespace.enum([
|
|
1464
1470
|
"media_unprobeable",
|
|
1465
1471
|
"media_format_indeterminate",
|
|
1472
|
+
"media_format_unsupported",
|
|
1466
1473
|
"media_too_large",
|
|
1467
1474
|
"media_aspect_ratio_unsupported",
|
|
1468
1475
|
"media_resolution_too_low",
|
|
@@ -1491,12 +1498,14 @@ z__namespace.object({
|
|
|
1491
1498
|
message: z__namespace.string(),
|
|
1492
1499
|
hint: z__namespace.string().optional(),
|
|
1493
1500
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1494
|
-
got: z__namespace.string().optional()
|
|
1501
|
+
got: z__namespace.string().optional(),
|
|
1502
|
+
display_error: z__namespace.string()
|
|
1495
1503
|
})),
|
|
1496
1504
|
errors: z__namespace.array(z__namespace.object({
|
|
1497
1505
|
code: z__namespace.enum([
|
|
1498
1506
|
"media_unprobeable",
|
|
1499
1507
|
"media_format_indeterminate",
|
|
1508
|
+
"media_format_unsupported",
|
|
1500
1509
|
"media_too_large",
|
|
1501
1510
|
"media_aspect_ratio_unsupported",
|
|
1502
1511
|
"media_resolution_too_low",
|
|
@@ -1525,7 +1534,8 @@ z__namespace.object({
|
|
|
1525
1534
|
message: z__namespace.string(),
|
|
1526
1535
|
hint: z__namespace.string().optional(),
|
|
1527
1536
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1528
|
-
got: z__namespace.string().optional()
|
|
1537
|
+
got: z__namespace.string().optional(),
|
|
1538
|
+
display_error: z__namespace.string()
|
|
1529
1539
|
}))
|
|
1530
1540
|
})),
|
|
1531
1541
|
external_id: z__namespace.string().nullable(),
|
|
@@ -1585,6 +1595,7 @@ z__namespace.object({
|
|
|
1585
1595
|
code: z__namespace.enum([
|
|
1586
1596
|
"media_unprobeable",
|
|
1587
1597
|
"media_format_indeterminate",
|
|
1598
|
+
"media_format_unsupported",
|
|
1588
1599
|
"media_too_large",
|
|
1589
1600
|
"media_aspect_ratio_unsupported",
|
|
1590
1601
|
"media_resolution_too_low",
|
|
@@ -1613,7 +1624,8 @@ z__namespace.object({
|
|
|
1613
1624
|
message: z__namespace.string(),
|
|
1614
1625
|
hint: z__namespace.string().optional(),
|
|
1615
1626
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1616
|
-
got: z__namespace.string().optional()
|
|
1627
|
+
got: z__namespace.string().optional(),
|
|
1628
|
+
display_error: z__namespace.string()
|
|
1617
1629
|
}).nullable(),
|
|
1618
1630
|
source: z__namespace.object({
|
|
1619
1631
|
format: z__namespace.string(),
|
|
@@ -1637,6 +1649,7 @@ z__namespace.object({
|
|
|
1637
1649
|
code: z__namespace.enum([
|
|
1638
1650
|
"media_unprobeable",
|
|
1639
1651
|
"media_format_indeterminate",
|
|
1652
|
+
"media_format_unsupported",
|
|
1640
1653
|
"media_too_large",
|
|
1641
1654
|
"media_aspect_ratio_unsupported",
|
|
1642
1655
|
"media_resolution_too_low",
|
|
@@ -1665,12 +1678,14 @@ z__namespace.object({
|
|
|
1665
1678
|
message: z__namespace.string(),
|
|
1666
1679
|
hint: z__namespace.string().optional(),
|
|
1667
1680
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1668
|
-
got: z__namespace.string().optional()
|
|
1681
|
+
got: z__namespace.string().optional(),
|
|
1682
|
+
display_error: z__namespace.string()
|
|
1669
1683
|
})),
|
|
1670
1684
|
errors: z__namespace.array(z__namespace.object({
|
|
1671
1685
|
code: z__namespace.enum([
|
|
1672
1686
|
"media_unprobeable",
|
|
1673
1687
|
"media_format_indeterminate",
|
|
1688
|
+
"media_format_unsupported",
|
|
1674
1689
|
"media_too_large",
|
|
1675
1690
|
"media_aspect_ratio_unsupported",
|
|
1676
1691
|
"media_resolution_too_low",
|
|
@@ -1699,7 +1714,8 @@ z__namespace.object({
|
|
|
1699
1714
|
message: z__namespace.string(),
|
|
1700
1715
|
hint: z__namespace.string().optional(),
|
|
1701
1716
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1702
|
-
got: z__namespace.string().optional()
|
|
1717
|
+
got: z__namespace.string().optional(),
|
|
1718
|
+
display_error: z__namespace.string()
|
|
1703
1719
|
}))
|
|
1704
1720
|
})),
|
|
1705
1721
|
external_id: z__namespace.string().nullable(),
|
|
@@ -1762,6 +1778,7 @@ z__namespace.object({
|
|
|
1762
1778
|
code: z__namespace.enum([
|
|
1763
1779
|
"media_unprobeable",
|
|
1764
1780
|
"media_format_indeterminate",
|
|
1781
|
+
"media_format_unsupported",
|
|
1765
1782
|
"media_too_large",
|
|
1766
1783
|
"media_aspect_ratio_unsupported",
|
|
1767
1784
|
"media_resolution_too_low",
|
|
@@ -1790,7 +1807,8 @@ z__namespace.object({
|
|
|
1790
1807
|
message: z__namespace.string(),
|
|
1791
1808
|
hint: z__namespace.string().optional(),
|
|
1792
1809
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1793
|
-
got: z__namespace.string().optional()
|
|
1810
|
+
got: z__namespace.string().optional(),
|
|
1811
|
+
display_error: z__namespace.string()
|
|
1794
1812
|
}).nullable(),
|
|
1795
1813
|
source: z__namespace.object({
|
|
1796
1814
|
format: z__namespace.string(),
|
|
@@ -1814,6 +1832,7 @@ z__namespace.object({
|
|
|
1814
1832
|
code: z__namespace.enum([
|
|
1815
1833
|
"media_unprobeable",
|
|
1816
1834
|
"media_format_indeterminate",
|
|
1835
|
+
"media_format_unsupported",
|
|
1817
1836
|
"media_too_large",
|
|
1818
1837
|
"media_aspect_ratio_unsupported",
|
|
1819
1838
|
"media_resolution_too_low",
|
|
@@ -1842,12 +1861,14 @@ z__namespace.object({
|
|
|
1842
1861
|
message: z__namespace.string(),
|
|
1843
1862
|
hint: z__namespace.string().optional(),
|
|
1844
1863
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1845
|
-
got: z__namespace.string().optional()
|
|
1864
|
+
got: z__namespace.string().optional(),
|
|
1865
|
+
display_error: z__namespace.string()
|
|
1846
1866
|
})),
|
|
1847
1867
|
errors: z__namespace.array(z__namespace.object({
|
|
1848
1868
|
code: z__namespace.enum([
|
|
1849
1869
|
"media_unprobeable",
|
|
1850
1870
|
"media_format_indeterminate",
|
|
1871
|
+
"media_format_unsupported",
|
|
1851
1872
|
"media_too_large",
|
|
1852
1873
|
"media_aspect_ratio_unsupported",
|
|
1853
1874
|
"media_resolution_too_low",
|
|
@@ -1876,7 +1897,8 @@ z__namespace.object({
|
|
|
1876
1897
|
message: z__namespace.string(),
|
|
1877
1898
|
hint: z__namespace.string().optional(),
|
|
1878
1899
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
1879
|
-
got: z__namespace.string().optional()
|
|
1900
|
+
got: z__namespace.string().optional(),
|
|
1901
|
+
display_error: z__namespace.string()
|
|
1880
1902
|
}))
|
|
1881
1903
|
})),
|
|
1882
1904
|
external_id: z__namespace.string().nullable(),
|
|
@@ -1969,7 +1991,8 @@ z__namespace.object({
|
|
|
1969
1991
|
}).nullable(),
|
|
1970
1992
|
error: z__namespace.object({
|
|
1971
1993
|
code: z__namespace.string(),
|
|
1972
|
-
message: z__namespace.string()
|
|
1994
|
+
message: z__namespace.string(),
|
|
1995
|
+
display_error: z__namespace.string()
|
|
1973
1996
|
}).nullable(),
|
|
1974
1997
|
media: z__namespace.array(z__namespace.object({
|
|
1975
1998
|
media_id: z__namespace.string(),
|
|
@@ -2248,7 +2271,8 @@ z__namespace.object({
|
|
|
2248
2271
|
}).nullable(),
|
|
2249
2272
|
error: z__namespace.object({
|
|
2250
2273
|
code: z__namespace.string(),
|
|
2251
|
-
message: z__namespace.string()
|
|
2274
|
+
message: z__namespace.string(),
|
|
2275
|
+
display_error: z__namespace.string()
|
|
2252
2276
|
}).nullable(),
|
|
2253
2277
|
media: z__namespace.array(z__namespace.object({
|
|
2254
2278
|
media_id: z__namespace.string(),
|
|
@@ -2330,7 +2354,8 @@ z__namespace.object({
|
|
|
2330
2354
|
}).nullable(),
|
|
2331
2355
|
error: z__namespace.object({
|
|
2332
2356
|
code: z__namespace.string(),
|
|
2333
|
-
message: z__namespace.string()
|
|
2357
|
+
message: z__namespace.string(),
|
|
2358
|
+
display_error: z__namespace.string()
|
|
2334
2359
|
}).nullable(),
|
|
2335
2360
|
media: z__namespace.array(z__namespace.object({
|
|
2336
2361
|
media_id: z__namespace.string(),
|
|
@@ -2606,7 +2631,8 @@ z__namespace.object({
|
|
|
2606
2631
|
}).nullable(),
|
|
2607
2632
|
error: z__namespace.object({
|
|
2608
2633
|
code: z__namespace.string(),
|
|
2609
|
-
message: z__namespace.string()
|
|
2634
|
+
message: z__namespace.string(),
|
|
2635
|
+
display_error: z__namespace.string()
|
|
2610
2636
|
}).nullable(),
|
|
2611
2637
|
media: z__namespace.array(z__namespace.object({
|
|
2612
2638
|
media_id: z__namespace.string(),
|
|
@@ -2861,6 +2887,7 @@ z__namespace.object({
|
|
|
2861
2887
|
"document_too_large",
|
|
2862
2888
|
"document_too_many_pages",
|
|
2863
2889
|
"media_format_indeterminate",
|
|
2890
|
+
"media_format_unsupported",
|
|
2864
2891
|
"media_count_invalid",
|
|
2865
2892
|
"body_too_long",
|
|
2866
2893
|
"content_missing",
|
|
@@ -2907,6 +2934,9 @@ z__namespace.object({
|
|
|
2907
2934
|
"tiktok_media_processing",
|
|
2908
2935
|
"tiktok_not_authorized",
|
|
2909
2936
|
"tiktok_rate_limited",
|
|
2937
|
+
"tiktok_url_ownership_unverified",
|
|
2938
|
+
"tiktok_unaudited_private_only",
|
|
2939
|
+
"tiktok_spam_risk",
|
|
2910
2940
|
"tiktok_publish_failed",
|
|
2911
2941
|
"post_publish_failed",
|
|
2912
2942
|
"post_partially_published",
|
|
@@ -2918,7 +2948,15 @@ z__namespace.object({
|
|
|
2918
2948
|
allowed: z__namespace.array(z__namespace.string()).optional(),
|
|
2919
2949
|
got: z__namespace.string().optional(),
|
|
2920
2950
|
variant_index: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
|
|
2921
|
-
path: z__namespace.array(z__namespace.union([z__namespace.string(), z__namespace.number()]))
|
|
2951
|
+
path: z__namespace.array(z__namespace.union([z__namespace.string(), z__namespace.number()])),
|
|
2952
|
+
platform: z__namespace.enum([
|
|
2953
|
+
"x",
|
|
2954
|
+
"linkedin",
|
|
2955
|
+
"facebook_page",
|
|
2956
|
+
"instagram",
|
|
2957
|
+
"tiktok"
|
|
2958
|
+
]).optional(),
|
|
2959
|
+
display_error: z__namespace.string()
|
|
2922
2960
|
}))
|
|
2923
2961
|
});
|
|
2924
2962
|
z__namespace.object({
|
|
@@ -4495,7 +4533,8 @@ z__namespace.object({
|
|
|
4495
4533
|
published_at: z__namespace.string().nullable(),
|
|
4496
4534
|
error: z__namespace.object({
|
|
4497
4535
|
code: z__namespace.string(),
|
|
4498
|
-
message: z__namespace.string()
|
|
4536
|
+
message: z__namespace.string(),
|
|
4537
|
+
display_error: z__namespace.string()
|
|
4499
4538
|
}).nullable()
|
|
4500
4539
|
}))
|
|
4501
4540
|
}).nullable(),
|
|
@@ -4578,7 +4617,8 @@ z__namespace.object({
|
|
|
4578
4617
|
published_at: z__namespace.string().nullable(),
|
|
4579
4618
|
error: z__namespace.object({
|
|
4580
4619
|
code: z__namespace.string(),
|
|
4581
|
-
message: z__namespace.string()
|
|
4620
|
+
message: z__namespace.string(),
|
|
4621
|
+
display_error: z__namespace.string()
|
|
4582
4622
|
}).nullable()
|
|
4583
4623
|
}))
|
|
4584
4624
|
}).nullable(),
|
|
@@ -6024,6 +6064,126 @@ function tiktokPrivacyLabel(value) {
|
|
|
6024
6064
|
}
|
|
6025
6065
|
}
|
|
6026
6066
|
|
|
6067
|
+
// src/tiktok-options.ts
|
|
6068
|
+
var TIKTOK_CAPTION_MAX = { video: 2200, photo: 4e3 };
|
|
6069
|
+
function captionMaxFor(postType) {
|
|
6070
|
+
return postType === "video" ? TIKTOK_CAPTION_MAX.video : TIKTOK_CAPTION_MAX.photo;
|
|
6071
|
+
}
|
|
6072
|
+
var TIKTOK_MUSIC_CONFIRMATION_URL = "https://www.tiktok.com/legal/page/global/music-usage-confirmation/en";
|
|
6073
|
+
var TIKTOK_BRANDED_CONTENT_POLICY_URL = "https://www.tiktok.com/legal/page/global/bc-policy/en";
|
|
6074
|
+
var TIKTOK_DISCLOSURE_REQUIRED_HINT = "You need to indicate if your content promotes yourself, a third party, or both.";
|
|
6075
|
+
var TIKTOK_AUDIENCE_REQUIRED_HINT = "Choose who can view this video before publishing.";
|
|
6076
|
+
var TIKTOK_PROCESSING_NOTICE = "After you publish, it may take a few minutes for your post to process and appear on your TikTok profile.";
|
|
6077
|
+
function defaultTikTokOptions() {
|
|
6078
|
+
return {
|
|
6079
|
+
privacy_level: void 0,
|
|
6080
|
+
allow_comment: false,
|
|
6081
|
+
allow_duet: false,
|
|
6082
|
+
allow_stitch: false,
|
|
6083
|
+
commercial_disclosure: false,
|
|
6084
|
+
your_brand: false,
|
|
6085
|
+
branded_content: false,
|
|
6086
|
+
aigc: false
|
|
6087
|
+
};
|
|
6088
|
+
}
|
|
6089
|
+
function privacyChoices(options) {
|
|
6090
|
+
return options.map((level) => ({ level, label: tiktokPrivacyLabel(level) }));
|
|
6091
|
+
}
|
|
6092
|
+
function parsePrivacyLevel(value, options) {
|
|
6093
|
+
return options.find((option) => option === value);
|
|
6094
|
+
}
|
|
6095
|
+
function discloses(value, kind) {
|
|
6096
|
+
return value.commercial_disclosure && value[kind];
|
|
6097
|
+
}
|
|
6098
|
+
function audiencePrivacyOptions(options, value) {
|
|
6099
|
+
return discloses(value, "branded_content") ? options.filter((option) => option !== "SELF_ONLY") : [...options];
|
|
6100
|
+
}
|
|
6101
|
+
function audienceUnselected(value) {
|
|
6102
|
+
return value.privacy_level === void 0;
|
|
6103
|
+
}
|
|
6104
|
+
function commercialDisclosureIncomplete(value) {
|
|
6105
|
+
return value.commercial_disclosure && !value.your_brand && !value.branded_content;
|
|
6106
|
+
}
|
|
6107
|
+
function brandedContentDeclared(value) {
|
|
6108
|
+
return discloses(value, "branded_content");
|
|
6109
|
+
}
|
|
6110
|
+
function commercialLabelNotice(value) {
|
|
6111
|
+
if (discloses(value, "branded_content")) {
|
|
6112
|
+
return "Your photo/video will be labeled as 'Paid partnership'";
|
|
6113
|
+
}
|
|
6114
|
+
if (discloses(value, "your_brand")) {
|
|
6115
|
+
return "Your photo/video will be labeled as 'Promotional content'";
|
|
6116
|
+
}
|
|
6117
|
+
return null;
|
|
6118
|
+
}
|
|
6119
|
+
function setCommercialDisclosure(value, on) {
|
|
6120
|
+
return on ? { ...value, commercial_disclosure: true } : {
|
|
6121
|
+
...value,
|
|
6122
|
+
commercial_disclosure: false,
|
|
6123
|
+
your_brand: false,
|
|
6124
|
+
branded_content: false
|
|
6125
|
+
};
|
|
6126
|
+
}
|
|
6127
|
+
function setBrandKind(value, kind, on) {
|
|
6128
|
+
const clearPrivacy = kind === "branded_content" && on && value.privacy_level === "SELF_ONLY";
|
|
6129
|
+
return {
|
|
6130
|
+
...value,
|
|
6131
|
+
[kind]: on,
|
|
6132
|
+
...clearPrivacy ? { privacy_level: void 0 } : {}
|
|
6133
|
+
};
|
|
6134
|
+
}
|
|
6135
|
+
function isInteractionForbidden(info, key) {
|
|
6136
|
+
return !info.interaction[key];
|
|
6137
|
+
}
|
|
6138
|
+
var INTERACTION_LABELS = {
|
|
6139
|
+
comment: "Comment",
|
|
6140
|
+
duet: "Duet",
|
|
6141
|
+
stitch: "Stitch"
|
|
6142
|
+
};
|
|
6143
|
+
var VIDEO_INTERACTIONS = [
|
|
6144
|
+
"comment",
|
|
6145
|
+
"duet",
|
|
6146
|
+
"stitch"
|
|
6147
|
+
];
|
|
6148
|
+
var PHOTO_INTERACTIONS = ["comment"];
|
|
6149
|
+
var INTERACTION_VALUE_KEY = {
|
|
6150
|
+
comment: "allow_comment",
|
|
6151
|
+
duet: "allow_duet",
|
|
6152
|
+
stitch: "allow_stitch"
|
|
6153
|
+
};
|
|
6154
|
+
function interactionRows(info, isVideo) {
|
|
6155
|
+
const order = isVideo ? VIDEO_INTERACTIONS : PHOTO_INTERACTIONS;
|
|
6156
|
+
return order.map((key) => ({
|
|
6157
|
+
key,
|
|
6158
|
+
label: INTERACTION_LABELS[key],
|
|
6159
|
+
disabled: isInteractionForbidden(info, key)
|
|
6160
|
+
}));
|
|
6161
|
+
}
|
|
6162
|
+
function interactionValueKey(key) {
|
|
6163
|
+
return INTERACTION_VALUE_KEY[key];
|
|
6164
|
+
}
|
|
6165
|
+
function toggleInteraction(value, key, on) {
|
|
6166
|
+
return { ...value, [INTERACTION_VALUE_KEY[key]]: on };
|
|
6167
|
+
}
|
|
6168
|
+
function tiktokSettings(value, isVideo) {
|
|
6169
|
+
const base = {
|
|
6170
|
+
privacy_level: value.privacy_level,
|
|
6171
|
+
disable_comment: !value.allow_comment,
|
|
6172
|
+
brand_organic_toggle: discloses(value, "your_brand"),
|
|
6173
|
+
brand_content_toggle: discloses(value, "branded_content")
|
|
6174
|
+
};
|
|
6175
|
+
return isVideo ? {
|
|
6176
|
+
...base,
|
|
6177
|
+
disable_duet: !value.allow_duet,
|
|
6178
|
+
disable_stitch: !value.allow_stitch,
|
|
6179
|
+
is_aigc: value.aigc
|
|
6180
|
+
} : base;
|
|
6181
|
+
}
|
|
6182
|
+
function tiktokOptionsReady(value) {
|
|
6183
|
+
const brandedPrivate = discloses(value, "branded_content") && value.privacy_level === "SELF_ONLY";
|
|
6184
|
+
return !audienceUnselected(value) && !commercialDisclosureIncomplete(value) && !brandedPrivate;
|
|
6185
|
+
}
|
|
6186
|
+
|
|
6027
6187
|
// src/compose.ts
|
|
6028
6188
|
var ComposeError = class extends Error {
|
|
6029
6189
|
constructor(message) {
|
|
@@ -6216,8 +6376,20 @@ function buildUpdatePost(input, connections = []) {
|
|
|
6216
6376
|
exports.ComposeError = ComposeError;
|
|
6217
6377
|
exports.POST_PLATFORMS = POST_PLATFORMS;
|
|
6218
6378
|
exports.PostrunError = PostrunError;
|
|
6379
|
+
exports.TIKTOK_AUDIENCE_REQUIRED_HINT = TIKTOK_AUDIENCE_REQUIRED_HINT;
|
|
6380
|
+
exports.TIKTOK_BRANDED_CONTENT_POLICY_URL = TIKTOK_BRANDED_CONTENT_POLICY_URL;
|
|
6381
|
+
exports.TIKTOK_CAPTION_MAX = TIKTOK_CAPTION_MAX;
|
|
6382
|
+
exports.TIKTOK_DISCLOSURE_REQUIRED_HINT = TIKTOK_DISCLOSURE_REQUIRED_HINT;
|
|
6383
|
+
exports.TIKTOK_MUSIC_CONFIRMATION_URL = TIKTOK_MUSIC_CONFIRMATION_URL;
|
|
6384
|
+
exports.TIKTOK_PROCESSING_NOTICE = TIKTOK_PROCESSING_NOTICE;
|
|
6385
|
+
exports.audiencePrivacyOptions = audiencePrivacyOptions;
|
|
6386
|
+
exports.audienceUnselected = audienceUnselected;
|
|
6387
|
+
exports.brandedContentDeclared = brandedContentDeclared;
|
|
6219
6388
|
exports.buildCreatePost = buildCreatePost;
|
|
6220
6389
|
exports.buildUpdatePost = buildUpdatePost;
|
|
6390
|
+
exports.captionMaxFor = captionMaxFor;
|
|
6391
|
+
exports.commercialDisclosureIncomplete = commercialDisclosureIncomplete;
|
|
6392
|
+
exports.commercialLabelNotice = commercialLabelNotice;
|
|
6221
6393
|
exports.connectionsConnect = connectionsConnect;
|
|
6222
6394
|
exports.connectionsDelete = connectionsDelete;
|
|
6223
6395
|
exports.connectionsGet = connectionsGet;
|
|
@@ -6225,6 +6397,7 @@ exports.connectionsListAccounts = connectionsListAccounts;
|
|
|
6225
6397
|
exports.connectionsListByProfile = connectionsListByProfile;
|
|
6226
6398
|
exports.connectionsSelect = connectionsSelect;
|
|
6227
6399
|
exports.createPostrunClient = createPostrunClient;
|
|
6400
|
+
exports.defaultTikTokOptions = defaultTikTokOptions;
|
|
6228
6401
|
exports.failedVariants = failedVariants;
|
|
6229
6402
|
exports.googleCreateAd = googleCreateAd;
|
|
6230
6403
|
exports.googleCreateAdGroup = googleCreateAdGroup;
|
|
@@ -6268,6 +6441,9 @@ exports.googleSetConversionGoal = googleSetConversionGoal;
|
|
|
6268
6441
|
exports.googleSetKeywordBid = googleSetKeywordBid;
|
|
6269
6442
|
exports.googleUploadConversions = googleUploadConversions;
|
|
6270
6443
|
exports.googleUploadImageAsset = googleUploadImageAsset;
|
|
6444
|
+
exports.interactionRows = interactionRows;
|
|
6445
|
+
exports.interactionValueKey = interactionValueKey;
|
|
6446
|
+
exports.isInteractionForbidden = isInteractionForbidden;
|
|
6271
6447
|
exports.isPostPlatform = isPostPlatform;
|
|
6272
6448
|
exports.isPublished = isPublished;
|
|
6273
6449
|
exports.logsGet = logsGet;
|
|
@@ -6285,19 +6461,26 @@ exports.metaAdsets = metaAdsets;
|
|
|
6285
6461
|
exports.metaCampaign = metaCampaign;
|
|
6286
6462
|
exports.metaCampaigns = metaCampaigns;
|
|
6287
6463
|
exports.metaInsights = metaInsights;
|
|
6464
|
+
exports.parsePrivacyLevel = parsePrivacyLevel;
|
|
6288
6465
|
exports.postsCreate = postsCreate;
|
|
6289
6466
|
exports.postsDelete = postsDelete;
|
|
6290
6467
|
exports.postsGet = postsGet;
|
|
6291
6468
|
exports.postsList = postsList;
|
|
6292
6469
|
exports.postsUpdate = postsUpdate;
|
|
6293
6470
|
exports.postsValidate = postsValidate;
|
|
6471
|
+
exports.privacyChoices = privacyChoices;
|
|
6294
6472
|
exports.profilesCreate = profilesCreate;
|
|
6295
6473
|
exports.profilesDelete = profilesDelete;
|
|
6296
6474
|
exports.profilesGet = profilesGet;
|
|
6297
6475
|
exports.profilesList = profilesList;
|
|
6298
6476
|
exports.profilesUpdate = profilesUpdate;
|
|
6477
|
+
exports.setBrandKind = setBrandKind;
|
|
6478
|
+
exports.setCommercialDisclosure = setCommercialDisclosure;
|
|
6299
6479
|
exports.tiktokCreatorInfo = tiktokCreatorInfo;
|
|
6480
|
+
exports.tiktokOptionsReady = tiktokOptionsReady;
|
|
6300
6481
|
exports.tiktokPrivacyLabel = tiktokPrivacyLabel;
|
|
6482
|
+
exports.tiktokSettings = tiktokSettings;
|
|
6483
|
+
exports.toggleInteraction = toggleInteraction;
|
|
6301
6484
|
exports.tokensMint = tokensMint;
|
|
6302
6485
|
exports.webhooksCreateEndpoint = webhooksCreateEndpoint;
|
|
6303
6486
|
exports.webhooksCreatePortal = webhooksCreatePortal;
|