bundlesocial 1.4.0 → 1.6.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.d.mts CHANGED
@@ -395,6 +395,9 @@ type PostCreateData = {
395
395
  madeForKids?: boolean | null;
396
396
  } | null;
397
397
  REDDIT?: {
398
+ /**
399
+ * Subreddit name. Example: r/subredditName or u/username
400
+ */
398
401
  sr: string;
399
402
  text: string;
400
403
  description?: string | null;
@@ -533,6 +536,9 @@ type PostCreateResponse = {
533
536
  madeForKids?: boolean | null;
534
537
  } | null;
535
538
  REDDIT?: {
539
+ /**
540
+ * Subreddit name. Example: r/subredditName or u/username
541
+ */
536
542
  sr: string;
537
543
  text: string;
538
544
  description?: string | null;
@@ -601,8 +607,9 @@ type PostCreateResponse = {
601
607
  } | null;
602
608
  FACEBOOK?: {
603
609
  id?: string | null;
604
- permalink?: string | null;
610
+ postId?: string | null;
605
611
  videoId?: string | null;
612
+ permalink?: string | null;
606
613
  } | null;
607
614
  INSTAGRAM?: {
608
615
  id?: string | null;
@@ -752,6 +759,9 @@ type PostGetListResponse = {
752
759
  madeForKids?: boolean | null;
753
760
  } | null;
754
761
  REDDIT?: {
762
+ /**
763
+ * Subreddit name. Example: r/subredditName or u/username
764
+ */
755
765
  sr: string;
756
766
  text: string;
757
767
  description?: string | null;
@@ -820,8 +830,9 @@ type PostGetListResponse = {
820
830
  } | null;
821
831
  FACEBOOK?: {
822
832
  id?: string | null;
823
- permalink?: string | null;
833
+ postId?: string | null;
824
834
  videoId?: string | null;
835
+ permalink?: string | null;
825
836
  } | null;
826
837
  INSTAGRAM?: {
827
838
  id?: string | null;
@@ -1025,6 +1036,9 @@ type PostGetResponse = {
1025
1036
  madeForKids?: boolean | null;
1026
1037
  } | null;
1027
1038
  REDDIT?: {
1039
+ /**
1040
+ * Subreddit name. Example: r/subredditName or u/username
1041
+ */
1028
1042
  sr: string;
1029
1043
  text: string;
1030
1044
  description?: string | null;
@@ -1093,8 +1107,9 @@ type PostGetResponse = {
1093
1107
  } | null;
1094
1108
  FACEBOOK?: {
1095
1109
  id?: string | null;
1096
- permalink?: string | null;
1110
+ postId?: string | null;
1097
1111
  videoId?: string | null;
1112
+ permalink?: string | null;
1098
1113
  } | null;
1099
1114
  INSTAGRAM?: {
1100
1115
  id?: string | null;
@@ -1296,6 +1311,9 @@ type PostUpdateData = {
1296
1311
  madeForKids?: boolean | null;
1297
1312
  } | null;
1298
1313
  REDDIT?: {
1314
+ /**
1315
+ * Subreddit name. Example: r/subredditName or u/username
1316
+ */
1299
1317
  sr: string;
1300
1318
  text: string;
1301
1319
  description?: string | null;
@@ -1434,6 +1452,9 @@ type PostUpdateResponse = {
1434
1452
  madeForKids?: boolean | null;
1435
1453
  } | null;
1436
1454
  REDDIT?: {
1455
+ /**
1456
+ * Subreddit name. Example: r/subredditName or u/username
1457
+ */
1437
1458
  sr: string;
1438
1459
  text: string;
1439
1460
  description?: string | null;
@@ -1502,8 +1523,9 @@ type PostUpdateResponse = {
1502
1523
  } | null;
1503
1524
  FACEBOOK?: {
1504
1525
  id?: string | null;
1505
- permalink?: string | null;
1526
+ postId?: string | null;
1506
1527
  videoId?: string | null;
1528
+ permalink?: string | null;
1507
1529
  } | null;
1508
1530
  INSTAGRAM?: {
1509
1531
  id?: string | null;
@@ -1646,6 +1668,9 @@ type PostDeleteResponse = {
1646
1668
  madeForKids?: boolean | null;
1647
1669
  } | null;
1648
1670
  REDDIT?: {
1671
+ /**
1672
+ * Subreddit name. Example: r/subredditName or u/username
1673
+ */
1649
1674
  sr: string;
1650
1675
  text: string;
1651
1676
  description?: string | null;
@@ -1714,8 +1739,9 @@ type PostDeleteResponse = {
1714
1739
  } | null;
1715
1740
  FACEBOOK?: {
1716
1741
  id?: string | null;
1717
- permalink?: string | null;
1742
+ postId?: string | null;
1718
1743
  videoId?: string | null;
1744
+ permalink?: string | null;
1719
1745
  } | null;
1720
1746
  INSTAGRAM?: {
1721
1747
  id?: string | null;
@@ -1800,6 +1826,12 @@ type $OpenApiTs = {
1800
1826
  404: {
1801
1827
  message: string;
1802
1828
  };
1829
+ /**
1830
+ * 429
1831
+ */
1832
+ 429: {
1833
+ message: string;
1834
+ };
1803
1835
  /**
1804
1836
  * 500
1805
1837
  */
@@ -1938,6 +1970,12 @@ type $OpenApiTs = {
1938
1970
  404: {
1939
1971
  message: string;
1940
1972
  };
1973
+ /**
1974
+ * 429
1975
+ */
1976
+ 429: {
1977
+ message: string;
1978
+ };
1941
1979
  /**
1942
1980
  * 500
1943
1981
  */
@@ -2002,6 +2040,12 @@ type $OpenApiTs = {
2002
2040
  404: {
2003
2041
  message: string;
2004
2042
  };
2043
+ /**
2044
+ * 429
2045
+ */
2046
+ 429: {
2047
+ message: string;
2048
+ };
2005
2049
  /**
2006
2050
  * 500
2007
2051
  */
@@ -2070,6 +2114,12 @@ type $OpenApiTs = {
2070
2114
  404: {
2071
2115
  message: string;
2072
2116
  };
2117
+ /**
2118
+ * 429
2119
+ */
2120
+ 429: {
2121
+ message: string;
2122
+ };
2073
2123
  /**
2074
2124
  * 500
2075
2125
  */
@@ -2132,6 +2182,12 @@ type $OpenApiTs = {
2132
2182
  404: {
2133
2183
  message: string;
2134
2184
  };
2185
+ /**
2186
+ * 429
2187
+ */
2188
+ 429: {
2189
+ message: string;
2190
+ };
2135
2191
  /**
2136
2192
  * 500
2137
2193
  */
@@ -2196,6 +2252,12 @@ type $OpenApiTs = {
2196
2252
  404: {
2197
2253
  message: string;
2198
2254
  };
2255
+ /**
2256
+ * 429
2257
+ */
2258
+ 429: {
2259
+ message: string;
2260
+ };
2199
2261
  /**
2200
2262
  * 500
2201
2263
  */
@@ -2258,6 +2320,12 @@ type $OpenApiTs = {
2258
2320
  404: {
2259
2321
  message: string;
2260
2322
  };
2323
+ /**
2324
+ * 429
2325
+ */
2326
+ 429: {
2327
+ message: string;
2328
+ };
2261
2329
  /**
2262
2330
  * 500
2263
2331
  */
@@ -2368,6 +2436,9 @@ type $OpenApiTs = {
2368
2436
  madeForKids?: boolean | null;
2369
2437
  } | null;
2370
2438
  REDDIT?: {
2439
+ /**
2440
+ * Subreddit name. Example: r/subredditName or u/username
2441
+ */
2371
2442
  sr: string;
2372
2443
  text: string;
2373
2444
  description?: string | null;
@@ -2436,8 +2507,9 @@ type $OpenApiTs = {
2436
2507
  } | null;
2437
2508
  FACEBOOK?: {
2438
2509
  id?: string | null;
2439
- permalink?: string | null;
2510
+ postId?: string | null;
2440
2511
  videoId?: string | null;
2512
+ permalink?: string | null;
2441
2513
  } | null;
2442
2514
  INSTAGRAM?: {
2443
2515
  id?: string | null;
@@ -2511,6 +2583,12 @@ type $OpenApiTs = {
2511
2583
  404: {
2512
2584
  message: string;
2513
2585
  };
2586
+ /**
2587
+ * 429
2588
+ */
2589
+ 429: {
2590
+ message: string;
2591
+ };
2514
2592
  /**
2515
2593
  * 500
2516
2594
  */
@@ -2620,6 +2698,9 @@ type $OpenApiTs = {
2620
2698
  madeForKids?: boolean | null;
2621
2699
  } | null;
2622
2700
  REDDIT?: {
2701
+ /**
2702
+ * Subreddit name. Example: r/subredditName or u/username
2703
+ */
2623
2704
  sr: string;
2624
2705
  text: string;
2625
2706
  description?: string | null;
@@ -2688,8 +2769,9 @@ type $OpenApiTs = {
2688
2769
  } | null;
2689
2770
  FACEBOOK?: {
2690
2771
  id?: string | null;
2691
- permalink?: string | null;
2772
+ postId?: string | null;
2692
2773
  videoId?: string | null;
2774
+ permalink?: string | null;
2693
2775
  } | null;
2694
2776
  INSTAGRAM?: {
2695
2777
  id?: string | null;
@@ -2824,6 +2906,12 @@ type $OpenApiTs = {
2824
2906
  404: {
2825
2907
  message: string;
2826
2908
  };
2909
+ /**
2910
+ * 429
2911
+ */
2912
+ 429: {
2913
+ message: string;
2914
+ };
2827
2915
  /**
2828
2916
  * 500
2829
2917
  */
@@ -2934,6 +3022,9 @@ type $OpenApiTs = {
2934
3022
  madeForKids?: boolean | null;
2935
3023
  } | null;
2936
3024
  REDDIT?: {
3025
+ /**
3026
+ * Subreddit name. Example: r/subredditName or u/username
3027
+ */
2937
3028
  sr: string;
2938
3029
  text: string;
2939
3030
  description?: string | null;
@@ -3002,8 +3093,9 @@ type $OpenApiTs = {
3002
3093
  } | null;
3003
3094
  FACEBOOK?: {
3004
3095
  id?: string | null;
3005
- permalink?: string | null;
3096
+ postId?: string | null;
3006
3097
  videoId?: string | null;
3098
+ permalink?: string | null;
3007
3099
  } | null;
3008
3100
  INSTAGRAM?: {
3009
3101
  id?: string | null;
@@ -3136,6 +3228,12 @@ type $OpenApiTs = {
3136
3228
  404: {
3137
3229
  message: string;
3138
3230
  };
3231
+ /**
3232
+ * 429
3233
+ */
3234
+ 429: {
3235
+ message: string;
3236
+ };
3139
3237
  /**
3140
3238
  * 500
3141
3239
  */
@@ -3244,6 +3342,9 @@ type $OpenApiTs = {
3244
3342
  madeForKids?: boolean | null;
3245
3343
  } | null;
3246
3344
  REDDIT?: {
3345
+ /**
3346
+ * Subreddit name. Example: r/subredditName or u/username
3347
+ */
3247
3348
  sr: string;
3248
3349
  text: string;
3249
3350
  description?: string | null;
@@ -3312,8 +3413,9 @@ type $OpenApiTs = {
3312
3413
  } | null;
3313
3414
  FACEBOOK?: {
3314
3415
  id?: string | null;
3315
- permalink?: string | null;
3416
+ postId?: string | null;
3316
3417
  videoId?: string | null;
3418
+ permalink?: string | null;
3317
3419
  } | null;
3318
3420
  INSTAGRAM?: {
3319
3421
  id?: string | null;
@@ -3387,6 +3489,12 @@ type $OpenApiTs = {
3387
3489
  404: {
3388
3490
  message: string;
3389
3491
  };
3492
+ /**
3493
+ * 429
3494
+ */
3495
+ 429: {
3496
+ message: string;
3497
+ };
3390
3498
  /**
3391
3499
  * 500
3392
3500
  */
@@ -3495,6 +3603,9 @@ type $OpenApiTs = {
3495
3603
  madeForKids?: boolean | null;
3496
3604
  } | null;
3497
3605
  REDDIT?: {
3606
+ /**
3607
+ * Subreddit name. Example: r/subredditName or u/username
3608
+ */
3498
3609
  sr: string;
3499
3610
  text: string;
3500
3611
  description?: string | null;
@@ -3563,8 +3674,9 @@ type $OpenApiTs = {
3563
3674
  } | null;
3564
3675
  FACEBOOK?: {
3565
3676
  id?: string | null;
3566
- permalink?: string | null;
3677
+ postId?: string | null;
3567
3678
  videoId?: string | null;
3679
+ permalink?: string | null;
3568
3680
  } | null;
3569
3681
  INSTAGRAM?: {
3570
3682
  id?: string | null;
@@ -3638,6 +3750,12 @@ type $OpenApiTs = {
3638
3750
  404: {
3639
3751
  message: string;
3640
3752
  };
3753
+ /**
3754
+ * 429
3755
+ */
3756
+ 429: {
3757
+ message: string;
3758
+ };
3641
3759
  /**
3642
3760
  * 500
3643
3761
  */
package/dist/index.d.ts CHANGED
@@ -395,6 +395,9 @@ type PostCreateData = {
395
395
  madeForKids?: boolean | null;
396
396
  } | null;
397
397
  REDDIT?: {
398
+ /**
399
+ * Subreddit name. Example: r/subredditName or u/username
400
+ */
398
401
  sr: string;
399
402
  text: string;
400
403
  description?: string | null;
@@ -533,6 +536,9 @@ type PostCreateResponse = {
533
536
  madeForKids?: boolean | null;
534
537
  } | null;
535
538
  REDDIT?: {
539
+ /**
540
+ * Subreddit name. Example: r/subredditName or u/username
541
+ */
536
542
  sr: string;
537
543
  text: string;
538
544
  description?: string | null;
@@ -601,8 +607,9 @@ type PostCreateResponse = {
601
607
  } | null;
602
608
  FACEBOOK?: {
603
609
  id?: string | null;
604
- permalink?: string | null;
610
+ postId?: string | null;
605
611
  videoId?: string | null;
612
+ permalink?: string | null;
606
613
  } | null;
607
614
  INSTAGRAM?: {
608
615
  id?: string | null;
@@ -752,6 +759,9 @@ type PostGetListResponse = {
752
759
  madeForKids?: boolean | null;
753
760
  } | null;
754
761
  REDDIT?: {
762
+ /**
763
+ * Subreddit name. Example: r/subredditName or u/username
764
+ */
755
765
  sr: string;
756
766
  text: string;
757
767
  description?: string | null;
@@ -820,8 +830,9 @@ type PostGetListResponse = {
820
830
  } | null;
821
831
  FACEBOOK?: {
822
832
  id?: string | null;
823
- permalink?: string | null;
833
+ postId?: string | null;
824
834
  videoId?: string | null;
835
+ permalink?: string | null;
825
836
  } | null;
826
837
  INSTAGRAM?: {
827
838
  id?: string | null;
@@ -1025,6 +1036,9 @@ type PostGetResponse = {
1025
1036
  madeForKids?: boolean | null;
1026
1037
  } | null;
1027
1038
  REDDIT?: {
1039
+ /**
1040
+ * Subreddit name. Example: r/subredditName or u/username
1041
+ */
1028
1042
  sr: string;
1029
1043
  text: string;
1030
1044
  description?: string | null;
@@ -1093,8 +1107,9 @@ type PostGetResponse = {
1093
1107
  } | null;
1094
1108
  FACEBOOK?: {
1095
1109
  id?: string | null;
1096
- permalink?: string | null;
1110
+ postId?: string | null;
1097
1111
  videoId?: string | null;
1112
+ permalink?: string | null;
1098
1113
  } | null;
1099
1114
  INSTAGRAM?: {
1100
1115
  id?: string | null;
@@ -1296,6 +1311,9 @@ type PostUpdateData = {
1296
1311
  madeForKids?: boolean | null;
1297
1312
  } | null;
1298
1313
  REDDIT?: {
1314
+ /**
1315
+ * Subreddit name. Example: r/subredditName or u/username
1316
+ */
1299
1317
  sr: string;
1300
1318
  text: string;
1301
1319
  description?: string | null;
@@ -1434,6 +1452,9 @@ type PostUpdateResponse = {
1434
1452
  madeForKids?: boolean | null;
1435
1453
  } | null;
1436
1454
  REDDIT?: {
1455
+ /**
1456
+ * Subreddit name. Example: r/subredditName or u/username
1457
+ */
1437
1458
  sr: string;
1438
1459
  text: string;
1439
1460
  description?: string | null;
@@ -1502,8 +1523,9 @@ type PostUpdateResponse = {
1502
1523
  } | null;
1503
1524
  FACEBOOK?: {
1504
1525
  id?: string | null;
1505
- permalink?: string | null;
1526
+ postId?: string | null;
1506
1527
  videoId?: string | null;
1528
+ permalink?: string | null;
1507
1529
  } | null;
1508
1530
  INSTAGRAM?: {
1509
1531
  id?: string | null;
@@ -1646,6 +1668,9 @@ type PostDeleteResponse = {
1646
1668
  madeForKids?: boolean | null;
1647
1669
  } | null;
1648
1670
  REDDIT?: {
1671
+ /**
1672
+ * Subreddit name. Example: r/subredditName or u/username
1673
+ */
1649
1674
  sr: string;
1650
1675
  text: string;
1651
1676
  description?: string | null;
@@ -1714,8 +1739,9 @@ type PostDeleteResponse = {
1714
1739
  } | null;
1715
1740
  FACEBOOK?: {
1716
1741
  id?: string | null;
1717
- permalink?: string | null;
1742
+ postId?: string | null;
1718
1743
  videoId?: string | null;
1744
+ permalink?: string | null;
1719
1745
  } | null;
1720
1746
  INSTAGRAM?: {
1721
1747
  id?: string | null;
@@ -1800,6 +1826,12 @@ type $OpenApiTs = {
1800
1826
  404: {
1801
1827
  message: string;
1802
1828
  };
1829
+ /**
1830
+ * 429
1831
+ */
1832
+ 429: {
1833
+ message: string;
1834
+ };
1803
1835
  /**
1804
1836
  * 500
1805
1837
  */
@@ -1938,6 +1970,12 @@ type $OpenApiTs = {
1938
1970
  404: {
1939
1971
  message: string;
1940
1972
  };
1973
+ /**
1974
+ * 429
1975
+ */
1976
+ 429: {
1977
+ message: string;
1978
+ };
1941
1979
  /**
1942
1980
  * 500
1943
1981
  */
@@ -2002,6 +2040,12 @@ type $OpenApiTs = {
2002
2040
  404: {
2003
2041
  message: string;
2004
2042
  };
2043
+ /**
2044
+ * 429
2045
+ */
2046
+ 429: {
2047
+ message: string;
2048
+ };
2005
2049
  /**
2006
2050
  * 500
2007
2051
  */
@@ -2070,6 +2114,12 @@ type $OpenApiTs = {
2070
2114
  404: {
2071
2115
  message: string;
2072
2116
  };
2117
+ /**
2118
+ * 429
2119
+ */
2120
+ 429: {
2121
+ message: string;
2122
+ };
2073
2123
  /**
2074
2124
  * 500
2075
2125
  */
@@ -2132,6 +2182,12 @@ type $OpenApiTs = {
2132
2182
  404: {
2133
2183
  message: string;
2134
2184
  };
2185
+ /**
2186
+ * 429
2187
+ */
2188
+ 429: {
2189
+ message: string;
2190
+ };
2135
2191
  /**
2136
2192
  * 500
2137
2193
  */
@@ -2196,6 +2252,12 @@ type $OpenApiTs = {
2196
2252
  404: {
2197
2253
  message: string;
2198
2254
  };
2255
+ /**
2256
+ * 429
2257
+ */
2258
+ 429: {
2259
+ message: string;
2260
+ };
2199
2261
  /**
2200
2262
  * 500
2201
2263
  */
@@ -2258,6 +2320,12 @@ type $OpenApiTs = {
2258
2320
  404: {
2259
2321
  message: string;
2260
2322
  };
2323
+ /**
2324
+ * 429
2325
+ */
2326
+ 429: {
2327
+ message: string;
2328
+ };
2261
2329
  /**
2262
2330
  * 500
2263
2331
  */
@@ -2368,6 +2436,9 @@ type $OpenApiTs = {
2368
2436
  madeForKids?: boolean | null;
2369
2437
  } | null;
2370
2438
  REDDIT?: {
2439
+ /**
2440
+ * Subreddit name. Example: r/subredditName or u/username
2441
+ */
2371
2442
  sr: string;
2372
2443
  text: string;
2373
2444
  description?: string | null;
@@ -2436,8 +2507,9 @@ type $OpenApiTs = {
2436
2507
  } | null;
2437
2508
  FACEBOOK?: {
2438
2509
  id?: string | null;
2439
- permalink?: string | null;
2510
+ postId?: string | null;
2440
2511
  videoId?: string | null;
2512
+ permalink?: string | null;
2441
2513
  } | null;
2442
2514
  INSTAGRAM?: {
2443
2515
  id?: string | null;
@@ -2511,6 +2583,12 @@ type $OpenApiTs = {
2511
2583
  404: {
2512
2584
  message: string;
2513
2585
  };
2586
+ /**
2587
+ * 429
2588
+ */
2589
+ 429: {
2590
+ message: string;
2591
+ };
2514
2592
  /**
2515
2593
  * 500
2516
2594
  */
@@ -2620,6 +2698,9 @@ type $OpenApiTs = {
2620
2698
  madeForKids?: boolean | null;
2621
2699
  } | null;
2622
2700
  REDDIT?: {
2701
+ /**
2702
+ * Subreddit name. Example: r/subredditName or u/username
2703
+ */
2623
2704
  sr: string;
2624
2705
  text: string;
2625
2706
  description?: string | null;
@@ -2688,8 +2769,9 @@ type $OpenApiTs = {
2688
2769
  } | null;
2689
2770
  FACEBOOK?: {
2690
2771
  id?: string | null;
2691
- permalink?: string | null;
2772
+ postId?: string | null;
2692
2773
  videoId?: string | null;
2774
+ permalink?: string | null;
2693
2775
  } | null;
2694
2776
  INSTAGRAM?: {
2695
2777
  id?: string | null;
@@ -2824,6 +2906,12 @@ type $OpenApiTs = {
2824
2906
  404: {
2825
2907
  message: string;
2826
2908
  };
2909
+ /**
2910
+ * 429
2911
+ */
2912
+ 429: {
2913
+ message: string;
2914
+ };
2827
2915
  /**
2828
2916
  * 500
2829
2917
  */
@@ -2934,6 +3022,9 @@ type $OpenApiTs = {
2934
3022
  madeForKids?: boolean | null;
2935
3023
  } | null;
2936
3024
  REDDIT?: {
3025
+ /**
3026
+ * Subreddit name. Example: r/subredditName or u/username
3027
+ */
2937
3028
  sr: string;
2938
3029
  text: string;
2939
3030
  description?: string | null;
@@ -3002,8 +3093,9 @@ type $OpenApiTs = {
3002
3093
  } | null;
3003
3094
  FACEBOOK?: {
3004
3095
  id?: string | null;
3005
- permalink?: string | null;
3096
+ postId?: string | null;
3006
3097
  videoId?: string | null;
3098
+ permalink?: string | null;
3007
3099
  } | null;
3008
3100
  INSTAGRAM?: {
3009
3101
  id?: string | null;
@@ -3136,6 +3228,12 @@ type $OpenApiTs = {
3136
3228
  404: {
3137
3229
  message: string;
3138
3230
  };
3231
+ /**
3232
+ * 429
3233
+ */
3234
+ 429: {
3235
+ message: string;
3236
+ };
3139
3237
  /**
3140
3238
  * 500
3141
3239
  */
@@ -3244,6 +3342,9 @@ type $OpenApiTs = {
3244
3342
  madeForKids?: boolean | null;
3245
3343
  } | null;
3246
3344
  REDDIT?: {
3345
+ /**
3346
+ * Subreddit name. Example: r/subredditName or u/username
3347
+ */
3247
3348
  sr: string;
3248
3349
  text: string;
3249
3350
  description?: string | null;
@@ -3312,8 +3413,9 @@ type $OpenApiTs = {
3312
3413
  } | null;
3313
3414
  FACEBOOK?: {
3314
3415
  id?: string | null;
3315
- permalink?: string | null;
3416
+ postId?: string | null;
3316
3417
  videoId?: string | null;
3418
+ permalink?: string | null;
3317
3419
  } | null;
3318
3420
  INSTAGRAM?: {
3319
3421
  id?: string | null;
@@ -3387,6 +3489,12 @@ type $OpenApiTs = {
3387
3489
  404: {
3388
3490
  message: string;
3389
3491
  };
3492
+ /**
3493
+ * 429
3494
+ */
3495
+ 429: {
3496
+ message: string;
3497
+ };
3390
3498
  /**
3391
3499
  * 500
3392
3500
  */
@@ -3495,6 +3603,9 @@ type $OpenApiTs = {
3495
3603
  madeForKids?: boolean | null;
3496
3604
  } | null;
3497
3605
  REDDIT?: {
3606
+ /**
3607
+ * Subreddit name. Example: r/subredditName or u/username
3608
+ */
3498
3609
  sr: string;
3499
3610
  text: string;
3500
3611
  description?: string | null;
@@ -3563,8 +3674,9 @@ type $OpenApiTs = {
3563
3674
  } | null;
3564
3675
  FACEBOOK?: {
3565
3676
  id?: string | null;
3566
- permalink?: string | null;
3677
+ postId?: string | null;
3567
3678
  videoId?: string | null;
3679
+ permalink?: string | null;
3568
3680
  } | null;
3569
3681
  INSTAGRAM?: {
3570
3682
  id?: string | null;
@@ -3638,6 +3750,12 @@ type $OpenApiTs = {
3638
3750
  404: {
3639
3751
  message: string;
3640
3752
  };
3753
+ /**
3754
+ * 429
3755
+ */
3756
+ 429: {
3757
+ message: string;
3758
+ };
3641
3759
  /**
3642
3760
  * 500
3643
3761
  */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var F=Object.create;var f=Object.defineProperty,W=Object.defineProperties,$=Object.getOwnPropertyDescriptor,V=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,K=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var U=(t,e,r)=>e in t?f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u=(t,e)=>{for(var r in e||(e={}))j.call(e,r)&&U(t,r,e[r]);if(N)for(var r of N(e))z.call(e,r)&&U(t,r,e[r]);return t},b=(t,e)=>W(t,V(e));var Q=(t,e)=>{for(var r in e)f(t,r,{get:e[r],enumerable:!0})},G=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of J(e))!j.call(t,o)&&o!==r&&f(t,o,{get:()=>e[o],enumerable:!(s=$(e,o))||s.enumerable});return t};var X=(t,e,r)=>(r=t!=null?F(K(t)):{},G(e||!t||!t.__esModule?f(r,"default",{value:t,enumerable:!0}):r,t)),Y=t=>G(f({},"__esModule",{value:!0}),t);var h=(t,e,r)=>new Promise((s,o)=>{var n=p=>{try{i(r.next(p))}catch(l){o(l)}},a=p=>{try{i(r.throw(p))}catch(l){o(l)}},i=p=>p.done?s(p.value):Promise.resolve(p.value).then(n,a);i((r=r.apply(t,e)).next())});var le={};Q(le,{ApiError:()=>d,BaseHttpRequest:()=>m,Bundlesocial:()=>g,CancelError:()=>y,CancelablePromise:()=>R,OpenAPI:()=>q});module.exports=Y(le);var c=class{constructor(){this._fns=[]}eject(e){let r=this._fns.indexOf(e);r!==-1&&(this._fns=[...this._fns.slice(0,r),...this._fns.slice(r+1)])}use(e){this._fns=[...this._fns,e]}},q={BASE:"https://api.bundle.social",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"1.0.0",WITH_CREDENTIALS:!1,interceptors:{request:new c,response:new c}};var m=class{constructor(e){this.config=e}};var d=class extends Error{constructor(r,s,o){super(o);this.name="ApiError",this.url=s.url,this.status=s.status,this.statusText=s.statusText,this.body=s.body,this.request=r}};var y=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},R=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((r,s)=>{this._resolve=r,this._reject=s;let o=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},a=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(a,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(a,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(a,"isCancelled",{get:()=>this._isCancelled}),e(o,n,a)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}cancel(){if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this.cancelHandlers.length)try{for(let e of this.cancelHandlers)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.cancelHandlers.length=0,this._reject&&this._reject(new y("Request aborted"))}}get isCancelled(){return this._isCancelled}};var T=t=>typeof t=="string",w=t=>T(t)&&t!=="",I=t=>t instanceof Blob,L=t=>t instanceof FormData,Z=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},ee=t=>{let e=[],r=(o,n)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(n))}`)},s=(o,n)=>{n!=null&&(n instanceof Date?r(o,n.toISOString()):Array.isArray(n)?n.forEach(a=>s(o,a)):typeof n=="object"?Object.entries(n).forEach(([a,i])=>s(`${o}[${a}]`,i)):r(o,n))};return Object.entries(t).forEach(([o,n])=>s(o,n)),e.length?`?${e.join("&")}`:""},te=(t,e)=>{let r=t.ENCODE_PATH||encodeURI,s=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(n,a)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(a)?r(String(e.path[a])):n}),o=t.BASE+s;return e.query?o+ee(e.query):o},re=t=>{if(t.formData){let e=new FormData,r=(s,o)=>{T(o)||I(o)?e.append(s,o):e.append(s,JSON.stringify(o))};return Object.entries(t.formData).filter(([,s])=>s!=null).forEach(([s,o])=>{Array.isArray(o)?o.forEach(n=>r(s,n)):r(s,o)}),e}},E=(t,e)=>h(void 0,null,function*(){return typeof e=="function"?e(t):e}),se=(t,e)=>h(void 0,null,function*(){let[r,s,o,n]=yield Promise.all([E(e,t.TOKEN),E(e,t.USERNAME),E(e,t.PASSWORD),E(e,t.HEADERS)]),a=Object.entries(u(u({Accept:"application/json"},n),e.headers)).filter(([,i])=>i!=null).reduce((i,[p,l])=>b(u({},i),{[p]:String(l)}),{});if(w(r)&&(a.Authorization=`Bearer ${r}`),w(s)&&w(o)){let i=Z(`${s}:${o}`);a.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?a["Content-Type"]=e.mediaType:I(e.body)?a["Content-Type"]=e.body.type||"application/octet-stream":T(e.body)?a["Content-Type"]="text/plain":L(e.body)||(a["Content-Type"]="application/json")),new Headers(a)}),oe=t=>{var e,r;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(r=t.mediaType)!=null&&r.includes("+json")?JSON.stringify(t.body):T(t.body)||I(t.body)||L(t.body)?t.body:JSON.stringify(t.body)},ne=(t,e,r,s,o,n,a)=>h(void 0,null,function*(){let i=new AbortController,p={headers:n,body:s!=null?s:o,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return a(()=>i.abort()),yield fetch(r,p)}),ie=(t,e)=>{if(e){let r=t.headers.get(e);if(T(r))return r}},ae=t=>h(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let r=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(r.some(s=>e.includes(s)))return yield t.blob();if(e.includes("multipart/form-data"))return yield t.formData();if(e.includes("text/"))return yield t.text()}}catch(e){console.error(e)}}),pe=(t,e)=>{var o,n;let s=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(s)throw new d(t,e,s);if(!e.ok){let a=(o=e.status)!=null?o:"unknown",i=(n=e.statusText)!=null?n:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new d(t,e,`Generic Error: status: ${a}; status text: ${i}; body: ${p}`)}},B=(t,e)=>new R((r,s,o)=>h(void 0,null,function*(){try{let n=te(t,e),a=re(e),i=oe(e),p=yield se(t,e);if(!o.isCancelled){let l=yield ne(t,e,n,i,a,p,o);for(let M of t.interceptors.response._fns)l=yield M(l);let A=yield ae(l),x=ie(l,e.responseHeader),H={url:n,ok:l.ok,status:l.status,statusText:l.statusText,body:x!=null?x:A};pe(e,H),r(H.body)}}catch(n){s(n)}}));var C=class extends m{constructor(e){super(e)}request(e){return B(this.config,e)}};var O=class{constructor(e){this.httpRequest=e}appGetHealth(){return this.httpRequest.request({method:"GET",url:"/api/v1/",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}},D=class{constructor(e){this.httpRequest=e}teamGetTeam(){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}},S=class{constructor(e){this.httpRequest=e}uploadCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/",formData:e.formData,mediaType:"multipart/form-data",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadGetList(){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadDeleteMany(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}},v=class{constructor(e){this.httpRequest=e}postCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/post/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{status:e.status,orderBy:e.orderBy,order:e.order,q:e.q,platforms:e.platforms,offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postUpdate(e){return this.httpRequest.request({method:"PUT",url:"/api/v1/post/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}};var P=class{constructor(e,r=C){var s,o,n,a,i,p,l,A;this.request=new r({BASE:(s=e==null?void 0:e.BASE)!=null?s:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"1.0.0",WITH_CREDENTIALS:(n=e==null?void 0:e.WITH_CREDENTIALS)!=null?n:!1,CREDENTIALS:(a=e==null?void 0:e.CREDENTIALS)!=null?a:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?p:new c,response:(A=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?A:new c}}),this.app=new O(this.request),this.post=new v(this.request),this.team=new D(this.request),this.upload=new S(this.request)}};var k=X(require("crypto"));var _=class{constructor(){}verifySignature(e,r,s){return k.default.createHmac("sha256",s).update(e).digest("hex")===r}constructEvent(e,r,s){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,r,s))throw new Error("Invalid signature");return JSON.parse(o)}},g=class extends P{constructor(r,s){super(b(u({},s),{HEADERS:b(u(u({},q.HEADERS),s==null?void 0:s.HEADERS),{"x-api-key":r})}));this.webhooks=new _}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI});
1
+ "use strict";var F=Object.create;var f=Object.defineProperty,W=Object.defineProperties,$=Object.getOwnPropertyDescriptor,V=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,K=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var U=(t,e,r)=>e in t?f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u=(t,e)=>{for(var r in e||(e={}))j.call(e,r)&&U(t,r,e[r]);if(N)for(var r of N(e))z.call(e,r)&&U(t,r,e[r]);return t},b=(t,e)=>W(t,V(e));var Q=(t,e)=>{for(var r in e)f(t,r,{get:e[r],enumerable:!0})},G=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of J(e))!j.call(t,o)&&o!==r&&f(t,o,{get:()=>e[o],enumerable:!(s=$(e,o))||s.enumerable});return t};var X=(t,e,r)=>(r=t!=null?F(K(t)):{},G(e||!t||!t.__esModule?f(r,"default",{value:t,enumerable:!0}):r,t)),Y=t=>G(f({},"__esModule",{value:!0}),t);var h=(t,e,r)=>new Promise((s,o)=>{var n=p=>{try{i(r.next(p))}catch(l){o(l)}},a=p=>{try{i(r.throw(p))}catch(l){o(l)}},i=p=>p.done?s(p.value):Promise.resolve(p.value).then(n,a);i((r=r.apply(t,e)).next())});var le={};Q(le,{ApiError:()=>d,BaseHttpRequest:()=>m,Bundlesocial:()=>g,CancelError:()=>y,CancelablePromise:()=>R,OpenAPI:()=>q});module.exports=Y(le);var c=class{constructor(){this._fns=[]}eject(e){let r=this._fns.indexOf(e);r!==-1&&(this._fns=[...this._fns.slice(0,r),...this._fns.slice(r+1)])}use(e){this._fns=[...this._fns,e]}},q={BASE:"https://api.bundle.social",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"1.0.0",WITH_CREDENTIALS:!1,interceptors:{request:new c,response:new c}};var m=class{constructor(e){this.config=e}};var d=class extends Error{constructor(r,s,o){super(o);this.name="ApiError",this.url=s.url,this.status=s.status,this.statusText=s.statusText,this.body=s.body,this.request=r}};var y=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},R=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((r,s)=>{this._resolve=r,this._reject=s;let o=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},a=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(a,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(a,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(a,"isCancelled",{get:()=>this._isCancelled}),e(o,n,a)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}cancel(){if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this.cancelHandlers.length)try{for(let e of this.cancelHandlers)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.cancelHandlers.length=0,this._reject&&this._reject(new y("Request aborted"))}}get isCancelled(){return this._isCancelled}};var T=t=>typeof t=="string",w=t=>T(t)&&t!=="",I=t=>t instanceof Blob,L=t=>t instanceof FormData,Z=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},ee=t=>{let e=[],r=(o,n)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(n))}`)},s=(o,n)=>{n!=null&&(n instanceof Date?r(o,n.toISOString()):Array.isArray(n)?n.forEach(a=>s(o,a)):typeof n=="object"?Object.entries(n).forEach(([a,i])=>s(`${o}[${a}]`,i)):r(o,n))};return Object.entries(t).forEach(([o,n])=>s(o,n)),e.length?`?${e.join("&")}`:""},te=(t,e)=>{let r=t.ENCODE_PATH||encodeURI,s=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(n,a)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(a)?r(String(e.path[a])):n}),o=t.BASE+s;return e.query?o+ee(e.query):o},re=t=>{if(t.formData){let e=new FormData,r=(s,o)=>{T(o)||I(o)?e.append(s,o):e.append(s,JSON.stringify(o))};return Object.entries(t.formData).filter(([,s])=>s!=null).forEach(([s,o])=>{Array.isArray(o)?o.forEach(n=>r(s,n)):r(s,o)}),e}},E=(t,e)=>h(void 0,null,function*(){return typeof e=="function"?e(t):e}),se=(t,e)=>h(void 0,null,function*(){let[r,s,o,n]=yield Promise.all([E(e,t.TOKEN),E(e,t.USERNAME),E(e,t.PASSWORD),E(e,t.HEADERS)]),a=Object.entries(u(u({Accept:"application/json"},n),e.headers)).filter(([,i])=>i!=null).reduce((i,[p,l])=>b(u({},i),{[p]:String(l)}),{});if(w(r)&&(a.Authorization=`Bearer ${r}`),w(s)&&w(o)){let i=Z(`${s}:${o}`);a.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?a["Content-Type"]=e.mediaType:I(e.body)?a["Content-Type"]=e.body.type||"application/octet-stream":T(e.body)?a["Content-Type"]="text/plain":L(e.body)||(a["Content-Type"]="application/json")),new Headers(a)}),oe=t=>{var e,r;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(r=t.mediaType)!=null&&r.includes("+json")?JSON.stringify(t.body):T(t.body)||I(t.body)||L(t.body)?t.body:JSON.stringify(t.body)},ne=(t,e,r,s,o,n,a)=>h(void 0,null,function*(){let i=new AbortController,p={headers:n,body:s!=null?s:o,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return a(()=>i.abort()),yield fetch(r,p)}),ie=(t,e)=>{if(e){let r=t.headers.get(e);if(T(r))return r}},ae=t=>h(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let r=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(r.some(s=>e.includes(s)))return yield t.blob();if(e.includes("multipart/form-data"))return yield t.formData();if(e.includes("text/"))return yield t.text()}}catch(e){console.error(e)}}),pe=(t,e)=>{var o,n;let s=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(s)throw new d(t,e,s);if(!e.ok){let a=(o=e.status)!=null?o:"unknown",i=(n=e.statusText)!=null?n:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new d(t,e,`Generic Error: status: ${a}; status text: ${i}; body: ${p}`)}},B=(t,e)=>new R((r,s,o)=>h(void 0,null,function*(){try{let n=te(t,e),a=re(e),i=oe(e),p=yield se(t,e);if(!o.isCancelled){let l=yield ne(t,e,n,i,a,p,o);for(let M of t.interceptors.response._fns)l=yield M(l);let A=yield ae(l),x=ie(l,e.responseHeader),H={url:n,ok:l.ok,status:l.status,statusText:l.statusText,body:x!=null?x:A};pe(e,H),r(H.body)}}catch(n){s(n)}}));var C=class extends m{constructor(e){super(e)}request(e){return B(this.config,e)}};var O=class{constructor(e){this.httpRequest=e}appGetHealth(){return this.httpRequest.request({method:"GET",url:"/api/v1/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},D=class{constructor(e){this.httpRequest=e}teamGetTeam(){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},S=class{constructor(e){this.httpRequest=e}uploadCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/",formData:e.formData,mediaType:"multipart/form-data",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadGetList(){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadDeleteMany(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},v=class{constructor(e){this.httpRequest=e}postCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/post/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{status:e.status,orderBy:e.orderBy,order:e.order,q:e.q,platforms:e.platforms,offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postUpdate(e){return this.httpRequest.request({method:"PUT",url:"/api/v1/post/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}};var P=class{constructor(e,r=C){var s,o,n,a,i,p,l,A;this.request=new r({BASE:(s=e==null?void 0:e.BASE)!=null?s:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"1.0.0",WITH_CREDENTIALS:(n=e==null?void 0:e.WITH_CREDENTIALS)!=null?n:!1,CREDENTIALS:(a=e==null?void 0:e.CREDENTIALS)!=null?a:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?p:new c,response:(A=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?A:new c}}),this.app=new O(this.request),this.post=new v(this.request),this.team=new D(this.request),this.upload=new S(this.request)}};var k=X(require("crypto"));var _=class{constructor(){}verifySignature(e,r,s){return k.default.createHmac("sha256",s).update(e).digest("hex")===r}constructEvent(e,r,s){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,r,s))throw new Error("Invalid signature");return JSON.parse(o)}},g=class extends P{constructor(r,s){super(b(u({},s),{HEADERS:b(u(u({},q.HEADERS),s==null?void 0:s.HEADERS),{"x-api-key":r})}));this.webhooks=new _}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var L=Object.defineProperty,B=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var H=(t,e,r)=>e in t?L(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u=(t,e)=>{for(var r in e||(e={}))M.call(e,r)&&H(t,r,e[r]);if(g)for(var r of g(e))F.call(e,r)&&H(t,r,e[r]);return t},y=(t,e)=>B(t,k(e));var m=(t,e,r)=>new Promise((s,o)=>{var n=p=>{try{i(r.next(p))}catch(l){o(l)}},a=p=>{try{i(r.throw(p))}catch(l){o(l)}},i=p=>p.done?s(p.value):Promise.resolve(p.value).then(n,a);i((r=r.apply(t,e)).next())});var d=class{constructor(){this._fns=[]}eject(e){let r=this._fns.indexOf(e);r!==-1&&(this._fns=[...this._fns.slice(0,r),...this._fns.slice(r+1)])}use(e){this._fns=[...this._fns,e]}},v={BASE:"https://api.bundle.social",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"1.0.0",WITH_CREDENTIALS:!1,interceptors:{request:new d,response:new d}};var R=class{constructor(e){this.config=e}};var c=class extends Error{constructor(r,s,o){super(o);this.name="ApiError",this.url=s.url,this.status=s.status,this.statusText=s.statusText,this.body=s.body,this.request=r}};var f=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},h=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((r,s)=>{this._resolve=r,this._reject=s;let o=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},a=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(a,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(a,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(a,"isCancelled",{get:()=>this._isCancelled}),e(o,n,a)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}cancel(){if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this.cancelHandlers.length)try{for(let e of this.cancelHandlers)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.cancelHandlers.length=0,this._reject&&this._reject(new f("Request aborted"))}}get isCancelled(){return this._isCancelled}};var b=t=>typeof t=="string",x=t=>b(t)&&t!=="",w=t=>t instanceof Blob,N=t=>t instanceof FormData,W=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},$=t=>{let e=[],r=(o,n)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(n))}`)},s=(o,n)=>{n!=null&&(n instanceof Date?r(o,n.toISOString()):Array.isArray(n)?n.forEach(a=>s(o,a)):typeof n=="object"?Object.entries(n).forEach(([a,i])=>s(`${o}[${a}]`,i)):r(o,n))};return Object.entries(t).forEach(([o,n])=>s(o,n)),e.length?`?${e.join("&")}`:""},V=(t,e)=>{let r=t.ENCODE_PATH||encodeURI,s=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(n,a)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(a)?r(String(e.path[a])):n}),o=t.BASE+s;return e.query?o+$(e.query):o},J=t=>{if(t.formData){let e=new FormData,r=(s,o)=>{b(o)||w(o)?e.append(s,o):e.append(s,JSON.stringify(o))};return Object.entries(t.formData).filter(([,s])=>s!=null).forEach(([s,o])=>{Array.isArray(o)?o.forEach(n=>r(s,n)):r(s,o)}),e}},A=(t,e)=>m(void 0,null,function*(){return typeof e=="function"?e(t):e}),K=(t,e)=>m(void 0,null,function*(){let[r,s,o,n]=yield Promise.all([A(e,t.TOKEN),A(e,t.USERNAME),A(e,t.PASSWORD),A(e,t.HEADERS)]),a=Object.entries(u(u({Accept:"application/json"},n),e.headers)).filter(([,i])=>i!=null).reduce((i,[p,l])=>y(u({},i),{[p]:String(l)}),{});if(x(r)&&(a.Authorization=`Bearer ${r}`),x(s)&&x(o)){let i=W(`${s}:${o}`);a.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?a["Content-Type"]=e.mediaType:w(e.body)?a["Content-Type"]=e.body.type||"application/octet-stream":b(e.body)?a["Content-Type"]="text/plain":N(e.body)||(a["Content-Type"]="application/json")),new Headers(a)}),z=t=>{var e,r;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(r=t.mediaType)!=null&&r.includes("+json")?JSON.stringify(t.body):b(t.body)||w(t.body)||N(t.body)?t.body:JSON.stringify(t.body)},Q=(t,e,r,s,o,n,a)=>m(void 0,null,function*(){let i=new AbortController,p={headers:n,body:s!=null?s:o,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return a(()=>i.abort()),yield fetch(r,p)}),X=(t,e)=>{if(e){let r=t.headers.get(e);if(b(r))return r}},Y=t=>m(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let r=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(r.some(s=>e.includes(s)))return yield t.blob();if(e.includes("multipart/form-data"))return yield t.formData();if(e.includes("text/"))return yield t.text()}}catch(e){console.error(e)}}),Z=(t,e)=>{var o,n;let s=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(s)throw new c(t,e,s);if(!e.ok){let a=(o=e.status)!=null?o:"unknown",i=(n=e.statusText)!=null?n:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new c(t,e,`Generic Error: status: ${a}; status text: ${i}; body: ${p}`)}},U=(t,e)=>new h((r,s,o)=>m(void 0,null,function*(){try{let n=V(t,e),a=J(e),i=z(e),p=yield K(t,e);if(!o.isCancelled){let l=yield Q(t,e,n,i,a,p,o);for(let G of t.interceptors.response._fns)l=yield G(l);let P=yield Y(l),S=X(l,e.responseHeader),_={url:n,ok:l.ok,status:l.status,statusText:l.statusText,body:S!=null?S:P};Z(e,_),r(_.body)}}catch(n){s(n)}}));var q=class extends R{constructor(e){super(e)}request(e){return U(this.config,e)}};var E=class{constructor(e){this.httpRequest=e}appGetHealth(){return this.httpRequest.request({method:"GET",url:"/api/v1/",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}},C=class{constructor(e){this.httpRequest=e}teamGetTeam(){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}},O=class{constructor(e){this.httpRequest=e}uploadCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/",formData:e.formData,mediaType:"multipart/form-data",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadGetList(){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadDeleteMany(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}uploadDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}},D=class{constructor(e){this.httpRequest=e}postCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/post/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{status:e.status,orderBy:e.orderBy,order:e.order,q:e.q,platforms:e.platforms,offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postUpdate(e){return this.httpRequest.request({method:"PUT",url:"/api/v1/post/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}postDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",500:"500"}})}};var T=class{constructor(e,r=q){var s,o,n,a,i,p,l,P;this.request=new r({BASE:(s=e==null?void 0:e.BASE)!=null?s:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"1.0.0",WITH_CREDENTIALS:(n=e==null?void 0:e.WITH_CREDENTIALS)!=null?n:!1,CREDENTIALS:(a=e==null?void 0:e.CREDENTIALS)!=null?a:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?p:new d,response:(P=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?P:new d}}),this.app=new E(this.request),this.post=new D(this.request),this.team=new C(this.request),this.upload=new O(this.request)}};import ee from"crypto";var I=class{constructor(){}verifySignature(e,r,s){return ee.createHmac("sha256",s).update(e).digest("hex")===r}constructEvent(e,r,s){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,r,s))throw new Error("Invalid signature");return JSON.parse(o)}},j=class extends T{constructor(r,s){super(y(u({},s),{HEADERS:y(u(u({},v.HEADERS),s==null?void 0:s.HEADERS),{"x-api-key":r})}));this.webhooks=new I}};export{c as ApiError,R as BaseHttpRequest,j as Bundlesocial,f as CancelError,h as CancelablePromise,v as OpenAPI};
1
+ var L=Object.defineProperty,B=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var H=(t,e,r)=>e in t?L(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u=(t,e)=>{for(var r in e||(e={}))M.call(e,r)&&H(t,r,e[r]);if(g)for(var r of g(e))F.call(e,r)&&H(t,r,e[r]);return t},y=(t,e)=>B(t,k(e));var m=(t,e,r)=>new Promise((s,o)=>{var n=p=>{try{i(r.next(p))}catch(l){o(l)}},a=p=>{try{i(r.throw(p))}catch(l){o(l)}},i=p=>p.done?s(p.value):Promise.resolve(p.value).then(n,a);i((r=r.apply(t,e)).next())});var d=class{constructor(){this._fns=[]}eject(e){let r=this._fns.indexOf(e);r!==-1&&(this._fns=[...this._fns.slice(0,r),...this._fns.slice(r+1)])}use(e){this._fns=[...this._fns,e]}},v={BASE:"https://api.bundle.social",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"1.0.0",WITH_CREDENTIALS:!1,interceptors:{request:new d,response:new d}};var R=class{constructor(e){this.config=e}};var c=class extends Error{constructor(r,s,o){super(o);this.name="ApiError",this.url=s.url,this.status=s.status,this.statusText=s.statusText,this.body=s.body,this.request=r}};var f=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},h=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((r,s)=>{this._resolve=r,this._reject=s;let o=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},a=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(a,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(a,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(a,"isCancelled",{get:()=>this._isCancelled}),e(o,n,a)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}cancel(){if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this.cancelHandlers.length)try{for(let e of this.cancelHandlers)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.cancelHandlers.length=0,this._reject&&this._reject(new f("Request aborted"))}}get isCancelled(){return this._isCancelled}};var b=t=>typeof t=="string",x=t=>b(t)&&t!=="",w=t=>t instanceof Blob,N=t=>t instanceof FormData,W=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},$=t=>{let e=[],r=(o,n)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(n))}`)},s=(o,n)=>{n!=null&&(n instanceof Date?r(o,n.toISOString()):Array.isArray(n)?n.forEach(a=>s(o,a)):typeof n=="object"?Object.entries(n).forEach(([a,i])=>s(`${o}[${a}]`,i)):r(o,n))};return Object.entries(t).forEach(([o,n])=>s(o,n)),e.length?`?${e.join("&")}`:""},V=(t,e)=>{let r=t.ENCODE_PATH||encodeURI,s=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(n,a)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(a)?r(String(e.path[a])):n}),o=t.BASE+s;return e.query?o+$(e.query):o},J=t=>{if(t.formData){let e=new FormData,r=(s,o)=>{b(o)||w(o)?e.append(s,o):e.append(s,JSON.stringify(o))};return Object.entries(t.formData).filter(([,s])=>s!=null).forEach(([s,o])=>{Array.isArray(o)?o.forEach(n=>r(s,n)):r(s,o)}),e}},A=(t,e)=>m(void 0,null,function*(){return typeof e=="function"?e(t):e}),K=(t,e)=>m(void 0,null,function*(){let[r,s,o,n]=yield Promise.all([A(e,t.TOKEN),A(e,t.USERNAME),A(e,t.PASSWORD),A(e,t.HEADERS)]),a=Object.entries(u(u({Accept:"application/json"},n),e.headers)).filter(([,i])=>i!=null).reduce((i,[p,l])=>y(u({},i),{[p]:String(l)}),{});if(x(r)&&(a.Authorization=`Bearer ${r}`),x(s)&&x(o)){let i=W(`${s}:${o}`);a.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?a["Content-Type"]=e.mediaType:w(e.body)?a["Content-Type"]=e.body.type||"application/octet-stream":b(e.body)?a["Content-Type"]="text/plain":N(e.body)||(a["Content-Type"]="application/json")),new Headers(a)}),z=t=>{var e,r;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(r=t.mediaType)!=null&&r.includes("+json")?JSON.stringify(t.body):b(t.body)||w(t.body)||N(t.body)?t.body:JSON.stringify(t.body)},Q=(t,e,r,s,o,n,a)=>m(void 0,null,function*(){let i=new AbortController,p={headers:n,body:s!=null?s:o,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return a(()=>i.abort()),yield fetch(r,p)}),X=(t,e)=>{if(e){let r=t.headers.get(e);if(b(r))return r}},Y=t=>m(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let r=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(r.some(s=>e.includes(s)))return yield t.blob();if(e.includes("multipart/form-data"))return yield t.formData();if(e.includes("text/"))return yield t.text()}}catch(e){console.error(e)}}),Z=(t,e)=>{var o,n;let s=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(s)throw new c(t,e,s);if(!e.ok){let a=(o=e.status)!=null?o:"unknown",i=(n=e.statusText)!=null?n:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new c(t,e,`Generic Error: status: ${a}; status text: ${i}; body: ${p}`)}},U=(t,e)=>new h((r,s,o)=>m(void 0,null,function*(){try{let n=V(t,e),a=J(e),i=z(e),p=yield K(t,e);if(!o.isCancelled){let l=yield Q(t,e,n,i,a,p,o);for(let G of t.interceptors.response._fns)l=yield G(l);let P=yield Y(l),S=X(l,e.responseHeader),_={url:n,ok:l.ok,status:l.status,statusText:l.statusText,body:S!=null?S:P};Z(e,_),r(_.body)}}catch(n){s(n)}}));var q=class extends R{constructor(e){super(e)}request(e){return U(this.config,e)}};var E=class{constructor(e){this.httpRequest=e}appGetHealth(){return this.httpRequest.request({method:"GET",url:"/api/v1/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},C=class{constructor(e){this.httpRequest=e}teamGetTeam(){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},O=class{constructor(e){this.httpRequest=e}uploadCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/",formData:e.formData,mediaType:"multipart/form-data",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadGetList(){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadDeleteMany(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/upload/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},D=class{constructor(e){this.httpRequest=e}postCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/post/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{status:e.status,orderBy:e.orderBy,order:e.order,q:e.q,platforms:e.platforms,offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postUpdate(e){return this.httpRequest.request({method:"PUT",url:"/api/v1/post/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}postDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}};var T=class{constructor(e,r=q){var s,o,n,a,i,p,l,P;this.request=new r({BASE:(s=e==null?void 0:e.BASE)!=null?s:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"1.0.0",WITH_CREDENTIALS:(n=e==null?void 0:e.WITH_CREDENTIALS)!=null?n:!1,CREDENTIALS:(a=e==null?void 0:e.CREDENTIALS)!=null?a:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?p:new d,response:(P=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?P:new d}}),this.app=new E(this.request),this.post=new D(this.request),this.team=new C(this.request),this.upload=new O(this.request)}};import ee from"crypto";var I=class{constructor(){}verifySignature(e,r,s){return ee.createHmac("sha256",s).update(e).digest("hex")===r}constructEvent(e,r,s){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,r,s))throw new Error("Invalid signature");return JSON.parse(o)}},j=class extends T{constructor(r,s){super(y(u({},s),{HEADERS:y(u(u({},v.HEADERS),s==null?void 0:s.HEADERS),{"x-api-key":r})}));this.webhooks=new I}};export{c as ApiError,R as BaseHttpRequest,j as Bundlesocial,f as CancelError,h as CancelablePromise,v as OpenAPI};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bundlesocial",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "Node.js library for the bundle.social API",
5
5
  "keywords": [
6
6
  "bundle.social",
package/readme.md CHANGED
@@ -15,8 +15,8 @@ pnpm add bundlesocial
15
15
  ```ts
16
16
  import { BundleSocial } from 'bundlesocial';
17
17
 
18
- const bundleSocial = new BundleSocial('YOUR_API_KEY');
19
18
  // Get the API key from the bundle.social dashboard
19
+ const bundleSocial = new BundleSocial('YOUR_API_KEY');
20
20
  ```
21
21
 
22
22
  ## Usage
@@ -28,14 +28,14 @@ const team = await bundlesocial.team.teamGetTeam();
28
28
  ### Upload a file
29
29
  ```ts
30
30
  const video = await fs.readFile('./video.mp4');
31
- const createdUpload = await bundlesocial.upload.uploadCreate({
31
+ const videoUpload = await bundlesocial.upload.uploadCreate({
32
32
  formData: {
33
33
  file: new Blob([video], { type: 'video/mp4' }),
34
34
  }
35
35
  });
36
36
 
37
37
  const jpgImage = await fs.readFile('./image.jpg');
38
- const createdUpload = await bundlesocial.upload.uploadCreate({
38
+ const jpgUpload = await bundlesocial.upload.uploadCreate({
39
39
  formData: {
40
40
  file: new Blob([jpgImage], { type: 'image/jpeg' }),
41
41
  }
@@ -72,9 +72,16 @@ const createdPost = await bundlesocial.post.postCreate({
72
72
  ],
73
73
  privacy: 'PUBLIC_TO_EVERYONE',
74
74
  },
75
+ REDDIT: {
76
+ sr: 'r/bundlesocial',
77
+ text: 'Test Post',
78
+ uploadIds: [
79
+ jpgUpload.id
80
+ ],
81
+ },
75
82
  },
76
83
  postDate: new Date().toISOString(),
77
- socialAccountTypes: ['INSTAGRAM', 'YOUTUBE', 'TIKTOK'],
84
+ socialAccountTypes: ['INSTAGRAM', 'YOUTUBE', 'TIKTOK', 'REDDIT'],
78
85
  status: 'SCHEDULED',
79
86
  title: 'Test Post',
80
87
  }
@@ -102,5 +109,31 @@ try {
102
109
  }
103
110
  ```
104
111
 
112
+ ## Handling webhook events
113
+ ```ts
114
+ // this is a simple example using express
115
+ app.post('/webhook', express.json({ type: 'application/json' }), (req, res) => {
116
+ const bundlesocial = new Bundlesocial(apiKey);
117
+ const signature = req.headers['x-signature'];
118
+
119
+ let event: WebhookEvent;
120
+
121
+ try {
122
+ // Verify the webhook signature and return a typed event
123
+ event = bundlesocial.webhooks.constructEvent(
124
+ req.body,
125
+ signature as string,
126
+ secret,
127
+ );
128
+ // Do something with the event
129
+ } catch (err) {
130
+ console.log(`Webhook signature verification failed.`, err);
131
+ return res.sendStatus(400);
132
+ }
133
+
134
+ return res.send();
135
+ });
136
+ ```
137
+
105
138
  ## License
106
139
  MIT