bundlesocial 2.18.0 → 2.20.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
@@ -98,6 +98,7 @@ type OrganizationGetOrganizationResponse = {
98
98
  } | null;
99
99
  apiAccess?: boolean;
100
100
  analyticsDisabled?: boolean;
101
+ analyticsPostsDisabled?: boolean;
101
102
  createdAt: string | null;
102
103
  updatedAt: string | null;
103
104
  deletedAt?: string | null;
@@ -266,6 +267,7 @@ type TeamGetTeamResponse = {
266
267
  } | null;
267
268
  apiAccess?: boolean;
268
269
  analyticsDisabled?: boolean;
270
+ analyticsPostsDisabled?: boolean;
269
271
  createdAt: string | null;
270
272
  updatedAt: string | null;
271
273
  deletedAt?: string | null;
@@ -313,6 +315,8 @@ type TeamGetTeamResponse = {
313
315
  url?: string | null;
314
316
  } | null;
315
317
  }> | null;
318
+ mastodonServerId?: string | null;
319
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
316
320
  createdAt: string | null;
317
321
  updatedAt: string | null;
318
322
  deletedAt?: string | null;
@@ -425,6 +429,7 @@ type TeamGetListResponse = {
425
429
  } | null;
426
430
  apiAccess?: boolean;
427
431
  analyticsDisabled?: boolean;
432
+ analyticsPostsDisabled?: boolean;
428
433
  createdAt: string | null;
429
434
  updatedAt: string | null;
430
435
  deletedAt?: string | null;
@@ -472,6 +477,8 @@ type TeamGetListResponse = {
472
477
  url?: string | null;
473
478
  } | null;
474
479
  }> | null;
480
+ mastodonServerId?: string | null;
481
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
475
482
  createdAt: string | null;
476
483
  updatedAt: string | null;
477
484
  deletedAt?: string | null;
@@ -548,6 +555,10 @@ type SocialAccountConnectData = {
548
555
  * Mastodon only
549
556
  */
550
557
  serverUrl?: string;
558
+ /**
559
+ * Instagram only - connection method
560
+ */
561
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM';
551
562
  };
552
563
  };
553
564
  type SocialAccountConnectResponse = {
@@ -586,6 +597,8 @@ type SocialAccountDisconnectResponse = {
586
597
  url?: string | null;
587
598
  } | null;
588
599
  }> | null;
600
+ mastodonServerId?: string | null;
601
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
589
602
  createdAt: string | null;
590
603
  updatedAt: string | null;
591
604
  deletedAt?: string | null;
@@ -621,6 +634,8 @@ type SocialAccountSetChannelResponse = {
621
634
  url?: string | null;
622
635
  } | null;
623
636
  }> | null;
637
+ mastodonServerId?: string | null;
638
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
624
639
  createdAt: string | null;
625
640
  updatedAt: string | null;
626
641
  deletedAt?: string | null;
@@ -655,6 +670,8 @@ type SocialAccountRefreshChannelsResponse = {
655
670
  url?: string | null;
656
671
  } | null;
657
672
  }> | null;
673
+ mastodonServerId?: string | null;
674
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
658
675
  createdAt: string | null;
659
676
  updatedAt: string | null;
660
677
  deletedAt?: string | null;
@@ -670,6 +687,7 @@ type SocialAccountCreatePortalLinkData = {
670
687
  logoUrl?: string;
671
688
  userLogoUrl?: string;
672
689
  userName?: string;
690
+ language?: 'en' | 'pl' | 'fr' | 'hi' | 'sv';
673
691
  };
674
692
  };
675
693
  type SocialAccountCreatePortalLinkResponse = {
@@ -710,6 +728,8 @@ type SocialAccountCopyResponse = Array<{
710
728
  url?: string | null;
711
729
  } | null;
712
730
  }> | null;
731
+ mastodonServerId?: string | null;
732
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
713
733
  createdAt: string | null;
714
734
  updatedAt: string | null;
715
735
  deletedAt?: string | null;
@@ -1254,6 +1274,8 @@ type PostGetResponse = {
1254
1274
  url?: string | null;
1255
1275
  } | null;
1256
1276
  }> | null;
1277
+ mastodonServerId?: string | null;
1278
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
1257
1279
  createdAt: string | null;
1258
1280
  updatedAt: string | null;
1259
1281
  deletedAt?: string | null;
@@ -2419,6 +2441,8 @@ type PostGetListResponse = {
2419
2441
  url?: string | null;
2420
2442
  } | null;
2421
2443
  }> | null;
2444
+ mastodonServerId?: string | null;
2445
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
2422
2446
  createdAt: string | null;
2423
2447
  updatedAt: string | null;
2424
2448
  deletedAt?: string | null;
@@ -2935,7 +2959,7 @@ type PostCreateResponse = {
2935
2959
  deletedAt?: string | null;
2936
2960
  };
2937
2961
  type AnalyticsGetSocialAccountAnalyticsData = {
2938
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
2962
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
2939
2963
  teamId: string;
2940
2964
  };
2941
2965
  type AnalyticsGetSocialAccountAnalyticsResponse = {
@@ -2960,6 +2984,8 @@ type AnalyticsGetSocialAccountAnalyticsResponse = {
2960
2984
  url?: string | null;
2961
2985
  } | null;
2962
2986
  }> | null;
2987
+ mastodonServerId?: string | null;
2988
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
2963
2989
  createdAt: string | null;
2964
2990
  updatedAt: string | null;
2965
2991
  deletedAt?: string | null;
@@ -2982,7 +3008,7 @@ type AnalyticsGetSocialAccountAnalyticsResponse = {
2982
3008
  }>;
2983
3009
  };
2984
3010
  type AnalyticsGetPostAnalyticsData = {
2985
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
3011
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
2986
3012
  postId: string;
2987
3013
  };
2988
3014
  type AnalyticsGetPostAnalyticsResponse = {
@@ -3297,7 +3323,7 @@ type AnalyticsGetPostAnalyticsResponse = {
3297
3323
  }>;
3298
3324
  };
3299
3325
  type AnalyticsGetSocialAccountAnalyticsRawData = {
3300
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
3326
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
3301
3327
  teamId: string;
3302
3328
  };
3303
3329
  type AnalyticsGetSocialAccountAnalyticsRawResponse = {
@@ -3322,6 +3348,8 @@ type AnalyticsGetSocialAccountAnalyticsRawResponse = {
3322
3348
  url?: string | null;
3323
3349
  } | null;
3324
3350
  }> | null;
3351
+ mastodonServerId?: string | null;
3352
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
3325
3353
  createdAt: string | null;
3326
3354
  updatedAt: string | null;
3327
3355
  deletedAt?: string | null;
@@ -3337,7 +3365,7 @@ type AnalyticsGetSocialAccountAnalyticsRawResponse = {
3337
3365
  }>;
3338
3366
  };
3339
3367
  type AnalyticsGetPostAnalyticsRawData = {
3340
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
3368
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
3341
3369
  postId: string;
3342
3370
  };
3343
3371
  type AnalyticsGetPostAnalyticsRawResponse = {
@@ -4019,6 +4047,7 @@ type CommentGetListData = {
4019
4047
  order?: 'ASC' | 'DESC';
4020
4048
  orderBy?: 'createdAt' | 'updatedAt' | 'deletedAt';
4021
4049
  platforms?: Array<('TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'LINKEDIN' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK')>;
4050
+ postId?: string;
4022
4051
  q?: string;
4023
4052
  status?: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
4024
4053
  teamId: string;
@@ -4735,6 +4764,7 @@ type $OpenApiTs = {
4735
4764
  } | null;
4736
4765
  apiAccess?: boolean;
4737
4766
  analyticsDisabled?: boolean;
4767
+ analyticsPostsDisabled?: boolean;
4738
4768
  createdAt: string | null;
4739
4769
  updatedAt: string | null;
4740
4770
  deletedAt?: string | null;
@@ -4950,6 +4980,7 @@ type $OpenApiTs = {
4950
4980
  } | null;
4951
4981
  apiAccess?: boolean;
4952
4982
  analyticsDisabled?: boolean;
4983
+ analyticsPostsDisabled?: boolean;
4953
4984
  createdAt: string | null;
4954
4985
  updatedAt: string | null;
4955
4986
  deletedAt?: string | null;
@@ -4997,6 +5028,8 @@ type $OpenApiTs = {
4997
5028
  url?: string | null;
4998
5029
  } | null;
4999
5030
  }> | null;
5031
+ mastodonServerId?: string | null;
5032
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5000
5033
  createdAt: string | null;
5001
5034
  updatedAt: string | null;
5002
5035
  deletedAt?: string | null;
@@ -5238,6 +5271,7 @@ type $OpenApiTs = {
5238
5271
  } | null;
5239
5272
  apiAccess?: boolean;
5240
5273
  analyticsDisabled?: boolean;
5274
+ analyticsPostsDisabled?: boolean;
5241
5275
  createdAt: string | null;
5242
5276
  updatedAt: string | null;
5243
5277
  deletedAt?: string | null;
@@ -5285,6 +5319,8 @@ type $OpenApiTs = {
5285
5319
  url?: string | null;
5286
5320
  } | null;
5287
5321
  }> | null;
5322
+ mastodonServerId?: string | null;
5323
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5288
5324
  createdAt: string | null;
5289
5325
  updatedAt: string | null;
5290
5326
  deletedAt?: string | null;
@@ -5514,6 +5550,8 @@ type $OpenApiTs = {
5514
5550
  url?: string | null;
5515
5551
  } | null;
5516
5552
  }> | null;
5553
+ mastodonServerId?: string | null;
5554
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5517
5555
  createdAt: string | null;
5518
5556
  updatedAt: string | null;
5519
5557
  deletedAt?: string | null;
@@ -5589,6 +5627,8 @@ type $OpenApiTs = {
5589
5627
  url?: string | null;
5590
5628
  } | null;
5591
5629
  }> | null;
5630
+ mastodonServerId?: string | null;
5631
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5592
5632
  createdAt: string | null;
5593
5633
  updatedAt: string | null;
5594
5634
  deletedAt?: string | null;
@@ -5664,6 +5704,8 @@ type $OpenApiTs = {
5664
5704
  url?: string | null;
5665
5705
  } | null;
5666
5706
  }> | null;
5707
+ mastodonServerId?: string | null;
5708
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5667
5709
  createdAt: string | null;
5668
5710
  updatedAt: string | null;
5669
5711
  deletedAt?: string | null;
@@ -5792,6 +5834,8 @@ type $OpenApiTs = {
5792
5834
  url?: string | null;
5793
5835
  } | null;
5794
5836
  }> | null;
5837
+ mastodonServerId?: string | null;
5838
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5795
5839
  createdAt: string | null;
5796
5840
  updatedAt: string | null;
5797
5841
  deletedAt?: string | null;
@@ -6680,6 +6724,8 @@ type $OpenApiTs = {
6680
6724
  url?: string | null;
6681
6725
  } | null;
6682
6726
  }> | null;
6727
+ mastodonServerId?: string | null;
6728
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
6683
6729
  createdAt: string | null;
6684
6730
  updatedAt: string | null;
6685
6731
  deletedAt?: string | null;
@@ -7763,6 +7809,8 @@ type $OpenApiTs = {
7763
7809
  url?: string | null;
7764
7810
  } | null;
7765
7811
  }> | null;
7812
+ mastodonServerId?: string | null;
7813
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
7766
7814
  createdAt: string | null;
7767
7815
  updatedAt: string | null;
7768
7816
  deletedAt?: string | null;
@@ -8183,6 +8231,8 @@ type $OpenApiTs = {
8183
8231
  url?: string | null;
8184
8232
  } | null;
8185
8233
  }> | null;
8234
+ mastodonServerId?: string | null;
8235
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
8186
8236
  createdAt: string | null;
8187
8237
  updatedAt: string | null;
8188
8238
  deletedAt?: string | null;
@@ -8637,6 +8687,8 @@ type $OpenApiTs = {
8637
8687
  url?: string | null;
8638
8688
  } | null;
8639
8689
  }> | null;
8690
+ mastodonServerId?: string | null;
8691
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
8640
8692
  createdAt: string | null;
8641
8693
  updatedAt: string | null;
8642
8694
  deletedAt?: string | null;
@@ -11160,6 +11212,7 @@ declare class CommentService {
11160
11212
  * Get comment list
11161
11213
  * @param data The data for the request.
11162
11214
  * @param data.teamId
11215
+ * @param data.postId
11163
11216
  * @param data.status
11164
11217
  * @param data.orderBy
11165
11218
  * @param data.order
package/dist/index.d.ts CHANGED
@@ -98,6 +98,7 @@ type OrganizationGetOrganizationResponse = {
98
98
  } | null;
99
99
  apiAccess?: boolean;
100
100
  analyticsDisabled?: boolean;
101
+ analyticsPostsDisabled?: boolean;
101
102
  createdAt: string | null;
102
103
  updatedAt: string | null;
103
104
  deletedAt?: string | null;
@@ -266,6 +267,7 @@ type TeamGetTeamResponse = {
266
267
  } | null;
267
268
  apiAccess?: boolean;
268
269
  analyticsDisabled?: boolean;
270
+ analyticsPostsDisabled?: boolean;
269
271
  createdAt: string | null;
270
272
  updatedAt: string | null;
271
273
  deletedAt?: string | null;
@@ -313,6 +315,8 @@ type TeamGetTeamResponse = {
313
315
  url?: string | null;
314
316
  } | null;
315
317
  }> | null;
318
+ mastodonServerId?: string | null;
319
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
316
320
  createdAt: string | null;
317
321
  updatedAt: string | null;
318
322
  deletedAt?: string | null;
@@ -425,6 +429,7 @@ type TeamGetListResponse = {
425
429
  } | null;
426
430
  apiAccess?: boolean;
427
431
  analyticsDisabled?: boolean;
432
+ analyticsPostsDisabled?: boolean;
428
433
  createdAt: string | null;
429
434
  updatedAt: string | null;
430
435
  deletedAt?: string | null;
@@ -472,6 +477,8 @@ type TeamGetListResponse = {
472
477
  url?: string | null;
473
478
  } | null;
474
479
  }> | null;
480
+ mastodonServerId?: string | null;
481
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
475
482
  createdAt: string | null;
476
483
  updatedAt: string | null;
477
484
  deletedAt?: string | null;
@@ -548,6 +555,10 @@ type SocialAccountConnectData = {
548
555
  * Mastodon only
549
556
  */
550
557
  serverUrl?: string;
558
+ /**
559
+ * Instagram only - connection method
560
+ */
561
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM';
551
562
  };
552
563
  };
553
564
  type SocialAccountConnectResponse = {
@@ -586,6 +597,8 @@ type SocialAccountDisconnectResponse = {
586
597
  url?: string | null;
587
598
  } | null;
588
599
  }> | null;
600
+ mastodonServerId?: string | null;
601
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
589
602
  createdAt: string | null;
590
603
  updatedAt: string | null;
591
604
  deletedAt?: string | null;
@@ -621,6 +634,8 @@ type SocialAccountSetChannelResponse = {
621
634
  url?: string | null;
622
635
  } | null;
623
636
  }> | null;
637
+ mastodonServerId?: string | null;
638
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
624
639
  createdAt: string | null;
625
640
  updatedAt: string | null;
626
641
  deletedAt?: string | null;
@@ -655,6 +670,8 @@ type SocialAccountRefreshChannelsResponse = {
655
670
  url?: string | null;
656
671
  } | null;
657
672
  }> | null;
673
+ mastodonServerId?: string | null;
674
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
658
675
  createdAt: string | null;
659
676
  updatedAt: string | null;
660
677
  deletedAt?: string | null;
@@ -670,6 +687,7 @@ type SocialAccountCreatePortalLinkData = {
670
687
  logoUrl?: string;
671
688
  userLogoUrl?: string;
672
689
  userName?: string;
690
+ language?: 'en' | 'pl' | 'fr' | 'hi' | 'sv';
673
691
  };
674
692
  };
675
693
  type SocialAccountCreatePortalLinkResponse = {
@@ -710,6 +728,8 @@ type SocialAccountCopyResponse = Array<{
710
728
  url?: string | null;
711
729
  } | null;
712
730
  }> | null;
731
+ mastodonServerId?: string | null;
732
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
713
733
  createdAt: string | null;
714
734
  updatedAt: string | null;
715
735
  deletedAt?: string | null;
@@ -1254,6 +1274,8 @@ type PostGetResponse = {
1254
1274
  url?: string | null;
1255
1275
  } | null;
1256
1276
  }> | null;
1277
+ mastodonServerId?: string | null;
1278
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
1257
1279
  createdAt: string | null;
1258
1280
  updatedAt: string | null;
1259
1281
  deletedAt?: string | null;
@@ -2419,6 +2441,8 @@ type PostGetListResponse = {
2419
2441
  url?: string | null;
2420
2442
  } | null;
2421
2443
  }> | null;
2444
+ mastodonServerId?: string | null;
2445
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
2422
2446
  createdAt: string | null;
2423
2447
  updatedAt: string | null;
2424
2448
  deletedAt?: string | null;
@@ -2935,7 +2959,7 @@ type PostCreateResponse = {
2935
2959
  deletedAt?: string | null;
2936
2960
  };
2937
2961
  type AnalyticsGetSocialAccountAnalyticsData = {
2938
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
2962
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
2939
2963
  teamId: string;
2940
2964
  };
2941
2965
  type AnalyticsGetSocialAccountAnalyticsResponse = {
@@ -2960,6 +2984,8 @@ type AnalyticsGetSocialAccountAnalyticsResponse = {
2960
2984
  url?: string | null;
2961
2985
  } | null;
2962
2986
  }> | null;
2987
+ mastodonServerId?: string | null;
2988
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
2963
2989
  createdAt: string | null;
2964
2990
  updatedAt: string | null;
2965
2991
  deletedAt?: string | null;
@@ -2982,7 +3008,7 @@ type AnalyticsGetSocialAccountAnalyticsResponse = {
2982
3008
  }>;
2983
3009
  };
2984
3010
  type AnalyticsGetPostAnalyticsData = {
2985
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
3011
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
2986
3012
  postId: string;
2987
3013
  };
2988
3014
  type AnalyticsGetPostAnalyticsResponse = {
@@ -3297,7 +3323,7 @@ type AnalyticsGetPostAnalyticsResponse = {
3297
3323
  }>;
3298
3324
  };
3299
3325
  type AnalyticsGetSocialAccountAnalyticsRawData = {
3300
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
3326
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
3301
3327
  teamId: string;
3302
3328
  };
3303
3329
  type AnalyticsGetSocialAccountAnalyticsRawResponse = {
@@ -3322,6 +3348,8 @@ type AnalyticsGetSocialAccountAnalyticsRawResponse = {
3322
3348
  url?: string | null;
3323
3349
  } | null;
3324
3350
  }> | null;
3351
+ mastodonServerId?: string | null;
3352
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
3325
3353
  createdAt: string | null;
3326
3354
  updatedAt: string | null;
3327
3355
  deletedAt?: string | null;
@@ -3337,7 +3365,7 @@ type AnalyticsGetSocialAccountAnalyticsRawResponse = {
3337
3365
  }>;
3338
3366
  };
3339
3367
  type AnalyticsGetPostAnalyticsRawData = {
3340
- platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON';
3368
+ platformType: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'REDDIT' | 'PINTEREST' | 'MASTODON' | 'LINKEDIN';
3341
3369
  postId: string;
3342
3370
  };
3343
3371
  type AnalyticsGetPostAnalyticsRawResponse = {
@@ -4019,6 +4047,7 @@ type CommentGetListData = {
4019
4047
  order?: 'ASC' | 'DESC';
4020
4048
  orderBy?: 'createdAt' | 'updatedAt' | 'deletedAt';
4021
4049
  platforms?: Array<('TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'THREADS' | 'LINKEDIN' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK')>;
4050
+ postId?: string;
4022
4051
  q?: string;
4023
4052
  status?: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
4024
4053
  teamId: string;
@@ -4735,6 +4764,7 @@ type $OpenApiTs = {
4735
4764
  } | null;
4736
4765
  apiAccess?: boolean;
4737
4766
  analyticsDisabled?: boolean;
4767
+ analyticsPostsDisabled?: boolean;
4738
4768
  createdAt: string | null;
4739
4769
  updatedAt: string | null;
4740
4770
  deletedAt?: string | null;
@@ -4950,6 +4980,7 @@ type $OpenApiTs = {
4950
4980
  } | null;
4951
4981
  apiAccess?: boolean;
4952
4982
  analyticsDisabled?: boolean;
4983
+ analyticsPostsDisabled?: boolean;
4953
4984
  createdAt: string | null;
4954
4985
  updatedAt: string | null;
4955
4986
  deletedAt?: string | null;
@@ -4997,6 +5028,8 @@ type $OpenApiTs = {
4997
5028
  url?: string | null;
4998
5029
  } | null;
4999
5030
  }> | null;
5031
+ mastodonServerId?: string | null;
5032
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5000
5033
  createdAt: string | null;
5001
5034
  updatedAt: string | null;
5002
5035
  deletedAt?: string | null;
@@ -5238,6 +5271,7 @@ type $OpenApiTs = {
5238
5271
  } | null;
5239
5272
  apiAccess?: boolean;
5240
5273
  analyticsDisabled?: boolean;
5274
+ analyticsPostsDisabled?: boolean;
5241
5275
  createdAt: string | null;
5242
5276
  updatedAt: string | null;
5243
5277
  deletedAt?: string | null;
@@ -5285,6 +5319,8 @@ type $OpenApiTs = {
5285
5319
  url?: string | null;
5286
5320
  } | null;
5287
5321
  }> | null;
5322
+ mastodonServerId?: string | null;
5323
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5288
5324
  createdAt: string | null;
5289
5325
  updatedAt: string | null;
5290
5326
  deletedAt?: string | null;
@@ -5514,6 +5550,8 @@ type $OpenApiTs = {
5514
5550
  url?: string | null;
5515
5551
  } | null;
5516
5552
  }> | null;
5553
+ mastodonServerId?: string | null;
5554
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5517
5555
  createdAt: string | null;
5518
5556
  updatedAt: string | null;
5519
5557
  deletedAt?: string | null;
@@ -5589,6 +5627,8 @@ type $OpenApiTs = {
5589
5627
  url?: string | null;
5590
5628
  } | null;
5591
5629
  }> | null;
5630
+ mastodonServerId?: string | null;
5631
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5592
5632
  createdAt: string | null;
5593
5633
  updatedAt: string | null;
5594
5634
  deletedAt?: string | null;
@@ -5664,6 +5704,8 @@ type $OpenApiTs = {
5664
5704
  url?: string | null;
5665
5705
  } | null;
5666
5706
  }> | null;
5707
+ mastodonServerId?: string | null;
5708
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5667
5709
  createdAt: string | null;
5668
5710
  updatedAt: string | null;
5669
5711
  deletedAt?: string | null;
@@ -5792,6 +5834,8 @@ type $OpenApiTs = {
5792
5834
  url?: string | null;
5793
5835
  } | null;
5794
5836
  }> | null;
5837
+ mastodonServerId?: string | null;
5838
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
5795
5839
  createdAt: string | null;
5796
5840
  updatedAt: string | null;
5797
5841
  deletedAt?: string | null;
@@ -6680,6 +6724,8 @@ type $OpenApiTs = {
6680
6724
  url?: string | null;
6681
6725
  } | null;
6682
6726
  }> | null;
6727
+ mastodonServerId?: string | null;
6728
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
6683
6729
  createdAt: string | null;
6684
6730
  updatedAt: string | null;
6685
6731
  deletedAt?: string | null;
@@ -7763,6 +7809,8 @@ type $OpenApiTs = {
7763
7809
  url?: string | null;
7764
7810
  } | null;
7765
7811
  }> | null;
7812
+ mastodonServerId?: string | null;
7813
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
7766
7814
  createdAt: string | null;
7767
7815
  updatedAt: string | null;
7768
7816
  deletedAt?: string | null;
@@ -8183,6 +8231,8 @@ type $OpenApiTs = {
8183
8231
  url?: string | null;
8184
8232
  } | null;
8185
8233
  }> | null;
8234
+ mastodonServerId?: string | null;
8235
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
8186
8236
  createdAt: string | null;
8187
8237
  updatedAt: string | null;
8188
8238
  deletedAt?: string | null;
@@ -8637,6 +8687,8 @@ type $OpenApiTs = {
8637
8687
  url?: string | null;
8638
8688
  } | null;
8639
8689
  }> | null;
8690
+ mastodonServerId?: string | null;
8691
+ instagramConnectionMethod?: 'FACEBOOK' | 'INSTAGRAM' | null;
8640
8692
  createdAt: string | null;
8641
8693
  updatedAt: string | null;
8642
8694
  deletedAt?: string | null;
@@ -11160,6 +11212,7 @@ declare class CommentService {
11160
11212
  * Get comment list
11161
11213
  * @param data The data for the request.
11162
11214
  * @param data.teamId
11215
+ * @param data.postId
11163
11216
  * @param data.status
11164
11217
  * @param data.orderBy
11165
11218
  * @param data.order
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var K=Object.create;var b=Object.defineProperty,J=Object.defineProperties,Q=Object.getOwnPropertyDescriptor,X=Object.getOwnPropertyDescriptors,Y=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,Z=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var N=(t,e,s)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,c=(t,e)=>{for(var s in e||(e={}))k.call(e,s)&&N(t,s,e[s]);if(j)for(var s of j(e))ee.call(e,s)&&N(t,s,e[s]);return t},P=(t,e)=>J(t,X(e));var te=(t,e)=>{for(var s in e)b(t,s,{get:e[s],enumerable:!0})},F=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Y(e))!k.call(t,o)&&o!==s&&b(t,o,{get:()=>e[o],enumerable:!(a=Q(e,o))||a.enumerable});return t};var se=(t,e,s)=>(s=t!=null?K(Z(t)):{},F(e||!t||!t.__esModule?b(s,"default",{value:t,enumerable:!0}):s,t)),ae=t=>F(b({},"__esModule",{value:!0}),t);var h=(t,e,s)=>new Promise((a,o)=>{var r=l=>{try{i(s.next(l))}catch(p){o(p)}},n=l=>{try{i(s.throw(l))}catch(p){o(p)}},i=l=>l.done?a(l.value):Promise.resolve(l.value).then(r,n);i((s=s.apply(t,e)).next())});var he={};te(he,{ApiError:()=>u,BaseHttpRequest:()=>m,Bundlesocial:()=>_,CancelError:()=>R,CancelablePromise:()=>y,OpenAPI:()=>q,webhookEventTypes:()=>ye});module.exports=ae(he);var d=class{constructor(){this._fns=[]}eject(e){let s=this._fns.indexOf(e);s!==-1&&(this._fns=[...this._fns.slice(0,s),...this._fns.slice(s+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 d,response:new d}};var m=class{constructor(e){this.config=e}};var u=class extends Error{constructor(s,a,o){super(o);this.name="ApiError",this.url=a.url,this.status=a.status,this.statusText=a.statusText,this.body=a.body,this.request=s}};var R=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},y=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((s,a)=>{this._resolve=s,this._reject=a;let o=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},r=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(n,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(n,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(n,"isCancelled",{get:()=>this._isCancelled}),e(o,r,n)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,s){return this.promise.then(e,s)}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 R("Request aborted"))}}get isCancelled(){return this._isCancelled}};var T=t=>typeof t=="string",L=t=>T(t)&&t!=="",H=t=>t instanceof Blob,V=t=>t instanceof FormData,oe=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},re=t=>{let e=[],s=(o,r)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(r))}`)},a=(o,r)=>{r!=null&&(r instanceof Date?s(o,r.toISOString()):Array.isArray(r)?r.forEach(n=>a(o,n)):typeof r=="object"?Object.entries(r).forEach(([n,i])=>a(`${o}[${n}]`,i)):s(o,r))};return Object.entries(t).forEach(([o,r])=>a(o,r)),e.length?`?${e.join("&")}`:""},ie=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,a=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(r,n)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(n)?s(String(e.path[n])):r}),o=t.BASE+a;return e.query?o+re(e.query):o},ne=t=>{if(t.formData){let e=new FormData,s=(a,o)=>{T(o)||H(o)?e.append(a,o):e.append(a,JSON.stringify(o))};return Object.entries(t.formData).filter(([,a])=>a!=null).forEach(([a,o])=>{Array.isArray(o)?o.forEach(r=>s(a,r)):s(a,o)}),e}},f=(t,e)=>h(void 0,null,function*(){return typeof e=="function"?e(t):e}),le=(t,e)=>h(void 0,null,function*(){let[s,a,o,r]=yield Promise.all([f(e,t.TOKEN),f(e,t.USERNAME),f(e,t.PASSWORD),f(e,t.HEADERS)]),n=Object.entries(c(c({Accept:"application/json"},r),e.headers)).filter(([,i])=>i!=null).reduce((i,[l,p])=>P(c({},i),{[l]:String(p)}),{});if(L(s)&&(n.Authorization=`Bearer ${s}`),L(a)&&L(o)){let i=oe(`${a}:${o}`);n.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?n["Content-Type"]=e.mediaType:H(e.body)?n["Content-Type"]=e.body.type||"application/octet-stream":T(e.body)?n["Content-Type"]="text/plain":V(e.body)||(n["Content-Type"]="application/json")),new Headers(n)}),pe=t=>{var e,s;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(s=t.mediaType)!=null&&s.includes("+json")?JSON.stringify(t.body):T(t.body)||H(t.body)||V(t.body)?t.body:JSON.stringify(t.body)},ce=(t,e,s,a,o,r,n)=>h(void 0,null,function*(){let i=new AbortController,l={headers:r,body:a!=null?a:o,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return n(()=>i.abort()),yield fetch(s,l)}),ue=(t,e)=>{if(e){let s=t.headers.get(e);if(T(s))return s}},de=t=>h(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let s=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(s.some(a=>e.includes(a)))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)}}),me=(t,e)=>{var o,r;let a=c({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(a)throw new u(t,e,a);if(!e.ok){let n=(o=e.status)!=null?o:"unknown",i=(r=e.statusText)!=null?r:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new u(t,e,`Generic Error: status: ${n}; status text: ${i}; body: ${l}`)}},z=(t,e)=>new y((s,a,o)=>h(void 0,null,function*(){try{let r=ie(t,e),n=ne(e),i=pe(e),l=yield le(t,e);if(!o.isCancelled){let p=yield ce(t,e,r,i,n,l,o);for(let $ of t.interceptors.response._fns)p=yield $(p);let C=yield de(p),g=ue(p,e.responseHeader),M={url:r,ok:p.ok,status:p.status,statusText:p.statusText,body:g!=null?g:C};me(e,M),s(M.body)}}catch(r){a(r)}}));var D=class extends m{constructor(e){super(e)}request(e){return z(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"}})}},S=class{constructor(e){this.httpRequest=e}organizationGetOrganization(){return this.httpRequest.request({method:"GET",url:"/api/v1/organization/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},G=class{constructor(e){this.httpRequest=e}teamGetTeam(e){return this.httpRequest.request({method:"GET",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamUpdateTeam(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/team/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamDeleteTeam(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",query:{offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamCreateTeam(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/team/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},v=class{constructor(e){this.httpRequest=e}socialAccountConnect(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/connect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountDisconnect(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/social-account/disconnect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountSetChannel(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/set-channel",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountRefreshChannels(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/refresh-channels",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCreatePortalLink(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/create-portal-link",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCopy(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/copy",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},O=class{constructor(e){this.httpRequest=e}uploadGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",query:{teamId:e.teamId,type:e.type,status:e.status},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}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"}})}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"}})}uploadInitLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/init",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadFinalizeLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/finalize",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},I=class{constructor(e){this.httpRequest=e}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:"PATCH",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"}})}postGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{teamId:e.teamId,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"}})}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"}})}},w=class{constructor(e){this.httpRequest=e}analyticsGetSocialAccountAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetSocialAccountAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account/raw",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post/raw",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfileAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePost(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePostByPostId(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawSocialAccountAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawPostsAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},x=class{constructor(e){this.httpRequest=e}commentGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentUpdate(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/comment/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/",query:{teamId:e.teamId,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"}})}commentCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/comment/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},U=class{constructor(e){this.httpRequest=e}miscSetThumbnail(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/thumbnail",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetChannelPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist",query:{teamId:e.teamId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscCreateNewChannelPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscUpdateChannelPlaylist(e={}){return this.httpRequest.request({method:"PUT",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteChannelPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist/{playlistId}",path:{playlistId:e.playlistId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscAddVideoToPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist-items",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetVideosFromPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist-items",query:{teamId:e.teamId,playlistId:e.playlistId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteVideoFromPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist-items/{playlistItemId}",path:{playlistItemId:e.playlistItemId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}};var A=class{constructor(e,s=D){var a,o,r,n,i,l,p,C;this.request=new s({BASE:(a=e==null?void 0:e.BASE)!=null?a:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"1.0.0",WITH_CREDENTIALS:(r=e==null?void 0:e.WITH_CREDENTIALS)!=null?r:!1,CREDENTIALS:(n=e==null?void 0:e.CREDENTIALS)!=null?n:"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:(l=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?l:new d,response:(C=(p=e==null?void 0:e.interceptors)==null?void 0:p.response)!=null?C:new d}}),this.analytics=new w(this.request),this.app=new E(this.request),this.comment=new x(this.request),this.misc=new U(this.request),this.organization=new S(this.request),this.post=new I(this.request),this.socialAccount=new v(this.request),this.team=new G(this.request),this.upload=new O(this.request)}};var W=se(require("crypto"));var ye=["post.published","comment.published","team.created","team.updated","team.deleted","social-account.created","social-account.updated","social-account.deleted"],B=class{constructor(){}verifySignature(e,s,a){return W.default.createHmac("sha256",a).update(e).digest("hex")===s}constructEvent(e,s,a){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,s,a))throw new Error("Invalid signature");return JSON.parse(o)}},_=class extends A{constructor(s,a){super(P(c({},a),{HEADERS:P(c(c({},q.HEADERS),a==null?void 0:a.HEADERS),{"x-api-key":s})}));this.webhooks=new B}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI,webhookEventTypes});
1
+ "use strict";var K=Object.create;var b=Object.defineProperty,J=Object.defineProperties,Q=Object.getOwnPropertyDescriptor,X=Object.getOwnPropertyDescriptors,Y=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,Z=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var N=(t,e,s)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,c=(t,e)=>{for(var s in e||(e={}))k.call(e,s)&&N(t,s,e[s]);if(j)for(var s of j(e))ee.call(e,s)&&N(t,s,e[s]);return t},P=(t,e)=>J(t,X(e));var te=(t,e)=>{for(var s in e)b(t,s,{get:e[s],enumerable:!0})},F=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Y(e))!k.call(t,a)&&a!==s&&b(t,a,{get:()=>e[a],enumerable:!(o=Q(e,a))||o.enumerable});return t};var se=(t,e,s)=>(s=t!=null?K(Z(t)):{},F(e||!t||!t.__esModule?b(s,"default",{value:t,enumerable:!0}):s,t)),oe=t=>F(b({},"__esModule",{value:!0}),t);var h=(t,e,s)=>new Promise((o,a)=>{var r=l=>{try{i(s.next(l))}catch(p){a(p)}},n=l=>{try{i(s.throw(l))}catch(p){a(p)}},i=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,n);i((s=s.apply(t,e)).next())});var he={};te(he,{ApiError:()=>u,BaseHttpRequest:()=>m,Bundlesocial:()=>_,CancelError:()=>R,CancelablePromise:()=>y,OpenAPI:()=>q,webhookEventTypes:()=>ye});module.exports=oe(he);var d=class{constructor(){this._fns=[]}eject(e){let s=this._fns.indexOf(e);s!==-1&&(this._fns=[...this._fns.slice(0,s),...this._fns.slice(s+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 d,response:new d}};var m=class{constructor(e){this.config=e}};var u=class extends Error{constructor(s,o,a){super(a);this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=s}};var R=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},y=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((s,o)=>{this._resolve=s,this._reject=o;let a=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},r=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(n,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(n,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(n,"isCancelled",{get:()=>this._isCancelled}),e(a,r,n)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,s){return this.promise.then(e,s)}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 R("Request aborted"))}}get isCancelled(){return this._isCancelled}};var T=t=>typeof t=="string",L=t=>T(t)&&t!=="",H=t=>t instanceof Blob,V=t=>t instanceof FormData,ae=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},re=t=>{let e=[],s=(a,r)=>{e.push(`${encodeURIComponent(a)}=${encodeURIComponent(String(r))}`)},o=(a,r)=>{r!=null&&(r instanceof Date?s(a,r.toISOString()):Array.isArray(r)?r.forEach(n=>o(a,n)):typeof r=="object"?Object.entries(r).forEach(([n,i])=>o(`${a}[${n}]`,i)):s(a,r))};return Object.entries(t).forEach(([a,r])=>o(a,r)),e.length?`?${e.join("&")}`:""},ie=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,o=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(r,n)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(n)?s(String(e.path[n])):r}),a=t.BASE+o;return e.query?a+re(e.query):a},ne=t=>{if(t.formData){let e=new FormData,s=(o,a)=>{T(a)||H(a)?e.append(o,a):e.append(o,JSON.stringify(a))};return Object.entries(t.formData).filter(([,o])=>o!=null).forEach(([o,a])=>{Array.isArray(a)?a.forEach(r=>s(o,r)):s(o,a)}),e}},f=(t,e)=>h(void 0,null,function*(){return typeof e=="function"?e(t):e}),le=(t,e)=>h(void 0,null,function*(){let[s,o,a,r]=yield Promise.all([f(e,t.TOKEN),f(e,t.USERNAME),f(e,t.PASSWORD),f(e,t.HEADERS)]),n=Object.entries(c(c({Accept:"application/json"},r),e.headers)).filter(([,i])=>i!=null).reduce((i,[l,p])=>P(c({},i),{[l]:String(p)}),{});if(L(s)&&(n.Authorization=`Bearer ${s}`),L(o)&&L(a)){let i=ae(`${o}:${a}`);n.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?n["Content-Type"]=e.mediaType:H(e.body)?n["Content-Type"]=e.body.type||"application/octet-stream":T(e.body)?n["Content-Type"]="text/plain":V(e.body)||(n["Content-Type"]="application/json")),new Headers(n)}),pe=t=>{var e,s;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(s=t.mediaType)!=null&&s.includes("+json")?JSON.stringify(t.body):T(t.body)||H(t.body)||V(t.body)?t.body:JSON.stringify(t.body)},ce=(t,e,s,o,a,r,n)=>h(void 0,null,function*(){let i=new AbortController,l={headers:r,body:o!=null?o:a,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return n(()=>i.abort()),yield fetch(s,l)}),ue=(t,e)=>{if(e){let s=t.headers.get(e);if(T(s))return s}},de=t=>h(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let s=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(s.some(o=>e.includes(o)))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)}}),me=(t,e)=>{var a,r;let o=c({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(o)throw new u(t,e,o);if(!e.ok){let n=(a=e.status)!=null?a:"unknown",i=(r=e.statusText)!=null?r:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new u(t,e,`Generic Error: status: ${n}; status text: ${i}; body: ${l}`)}},z=(t,e)=>new y((s,o,a)=>h(void 0,null,function*(){try{let r=ie(t,e),n=ne(e),i=pe(e),l=yield le(t,e);if(!a.isCancelled){let p=yield ce(t,e,r,i,n,l,a);for(let $ of t.interceptors.response._fns)p=yield $(p);let C=yield de(p),g=ue(p,e.responseHeader),M={url:r,ok:p.ok,status:p.status,statusText:p.statusText,body:g!=null?g:C};me(e,M),s(M.body)}}catch(r){o(r)}}));var D=class extends m{constructor(e){super(e)}request(e){return z(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"}})}},S=class{constructor(e){this.httpRequest=e}organizationGetOrganization(){return this.httpRequest.request({method:"GET",url:"/api/v1/organization/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},G=class{constructor(e){this.httpRequest=e}teamGetTeam(e){return this.httpRequest.request({method:"GET",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamUpdateTeam(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/team/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamDeleteTeam(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",query:{offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamCreateTeam(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/team/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},v=class{constructor(e){this.httpRequest=e}socialAccountConnect(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/connect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountDisconnect(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/social-account/disconnect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountSetChannel(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/set-channel",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountRefreshChannels(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/refresh-channels",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCreatePortalLink(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/create-portal-link",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCopy(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/copy",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},O=class{constructor(e){this.httpRequest=e}uploadGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",query:{teamId:e.teamId,type:e.type,status:e.status},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}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"}})}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"}})}uploadInitLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/init",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadFinalizeLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/finalize",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},I=class{constructor(e){this.httpRequest=e}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:"PATCH",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"}})}postGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{teamId:e.teamId,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"}})}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"}})}},w=class{constructor(e){this.httpRequest=e}analyticsGetSocialAccountAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetSocialAccountAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account/raw",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post/raw",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfileAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePost(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePostByPostId(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawSocialAccountAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawPostsAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},x=class{constructor(e){this.httpRequest=e}commentGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentUpdate(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/comment/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/",query:{teamId:e.teamId,postId:e.postId,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"}})}commentCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/comment/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},U=class{constructor(e){this.httpRequest=e}miscSetThumbnail(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/thumbnail",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetChannelPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist",query:{teamId:e.teamId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscCreateNewChannelPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscUpdateChannelPlaylist(e={}){return this.httpRequest.request({method:"PUT",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteChannelPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist/{playlistId}",path:{playlistId:e.playlistId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscAddVideoToPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist-items",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetVideosFromPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist-items",query:{teamId:e.teamId,playlistId:e.playlistId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteVideoFromPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist-items/{playlistItemId}",path:{playlistItemId:e.playlistItemId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}};var A=class{constructor(e,s=D){var o,a,r,n,i,l,p,C;this.request=new s({BASE:(o=e==null?void 0:e.BASE)!=null?o:"https://api.bundle.social",VERSION:(a=e==null?void 0:e.VERSION)!=null?a:"1.0.0",WITH_CREDENTIALS:(r=e==null?void 0:e.WITH_CREDENTIALS)!=null?r:!1,CREDENTIALS:(n=e==null?void 0:e.CREDENTIALS)!=null?n:"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:(l=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?l:new d,response:(C=(p=e==null?void 0:e.interceptors)==null?void 0:p.response)!=null?C:new d}}),this.analytics=new w(this.request),this.app=new E(this.request),this.comment=new x(this.request),this.misc=new U(this.request),this.organization=new S(this.request),this.post=new I(this.request),this.socialAccount=new v(this.request),this.team=new G(this.request),this.upload=new O(this.request)}};var W=se(require("crypto"));var ye=["post.published","comment.published","team.created","team.updated","team.deleted","social-account.created","social-account.updated","social-account.deleted"],B=class{constructor(){}verifySignature(e,s,o){return W.default.createHmac("sha256",o).update(e).digest("hex")===s}constructEvent(e,s,o){let a=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(a,s,o))throw new Error("Invalid signature");return JSON.parse(a)}},_=class extends A{constructor(s,o){super(P(c({},o),{HEADERS:P(c(c({},q.HEADERS),o==null?void 0:o.HEADERS),{"x-api-key":s})}));this.webhooks=new B}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI,webhookEventTypes});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var V=Object.defineProperty,z=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var M=(t,e,s)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,c=(t,e)=>{for(var s in e||(e={}))$.call(e,s)&&M(t,s,e[s]);if(_)for(var s of _(e))K.call(e,s)&&M(t,s,e[s]);return t},R=(t,e)=>z(t,W(e));var m=(t,e,s)=>new Promise((a,o)=>{var r=l=>{try{i(s.next(l))}catch(p){o(p)}},n=l=>{try{i(s.throw(l))}catch(p){o(p)}},i=l=>l.done?a(l.value):Promise.resolve(l.value).then(r,n);i((s=s.apply(t,e)).next())});var u=class{constructor(){this._fns=[]}eject(e){let s=this._fns.indexOf(e);s!==-1&&(this._fns=[...this._fns.slice(0,s),...this._fns.slice(s+1)])}use(e){this._fns=[...this._fns,e]}},U={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 u,response:new u}};var y=class{constructor(e){this.config=e}};var d=class extends Error{constructor(s,a,o){super(o);this.name="ApiError",this.url=a.url,this.status=a.status,this.statusText=a.statusText,this.body=a.body,this.request=s}};var b=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((s,a)=>{this._resolve=s,this._reject=a;let o=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},r=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(n,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(n,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(n,"isCancelled",{get:()=>this._isCancelled}),e(o,r,n)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,s){return this.promise.then(e,s)}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 b("Request aborted"))}}get isCancelled(){return this._isCancelled}};var P=t=>typeof t=="string",g=t=>P(t)&&t!=="",L=t=>t instanceof Blob,j=t=>t instanceof FormData,J=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},Q=t=>{let e=[],s=(o,r)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(r))}`)},a=(o,r)=>{r!=null&&(r instanceof Date?s(o,r.toISOString()):Array.isArray(r)?r.forEach(n=>a(o,n)):typeof r=="object"?Object.entries(r).forEach(([n,i])=>a(`${o}[${n}]`,i)):s(o,r))};return Object.entries(t).forEach(([o,r])=>a(o,r)),e.length?`?${e.join("&")}`:""},X=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,a=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(r,n)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(n)?s(String(e.path[n])):r}),o=t.BASE+a;return e.query?o+Q(e.query):o},Y=t=>{if(t.formData){let e=new FormData,s=(a,o)=>{P(o)||L(o)?e.append(a,o):e.append(a,JSON.stringify(o))};return Object.entries(t.formData).filter(([,a])=>a!=null).forEach(([a,o])=>{Array.isArray(o)?o.forEach(r=>s(a,r)):s(a,o)}),e}},C=(t,e)=>m(void 0,null,function*(){return typeof e=="function"?e(t):e}),Z=(t,e)=>m(void 0,null,function*(){let[s,a,o,r]=yield Promise.all([C(e,t.TOKEN),C(e,t.USERNAME),C(e,t.PASSWORD),C(e,t.HEADERS)]),n=Object.entries(c(c({Accept:"application/json"},r),e.headers)).filter(([,i])=>i!=null).reduce((i,[l,p])=>R(c({},i),{[l]:String(p)}),{});if(g(s)&&(n.Authorization=`Bearer ${s}`),g(a)&&g(o)){let i=J(`${a}:${o}`);n.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?n["Content-Type"]=e.mediaType:L(e.body)?n["Content-Type"]=e.body.type||"application/octet-stream":P(e.body)?n["Content-Type"]="text/plain":j(e.body)||(n["Content-Type"]="application/json")),new Headers(n)}),ee=t=>{var e,s;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(s=t.mediaType)!=null&&s.includes("+json")?JSON.stringify(t.body):P(t.body)||L(t.body)||j(t.body)?t.body:JSON.stringify(t.body)},te=(t,e,s,a,o,r,n)=>m(void 0,null,function*(){let i=new AbortController,l={headers:r,body:a!=null?a:o,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return n(()=>i.abort()),yield fetch(s,l)}),se=(t,e)=>{if(e){let s=t.headers.get(e);if(P(s))return s}},ae=t=>m(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let s=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(s.some(a=>e.includes(a)))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)}}),oe=(t,e)=>{var o,r;let a=c({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(a)throw new d(t,e,a);if(!e.ok){let n=(o=e.status)!=null?o:"unknown",i=(r=e.statusText)!=null?r:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new d(t,e,`Generic Error: status: ${n}; status text: ${i}; body: ${l}`)}},N=(t,e)=>new h((s,a,o)=>m(void 0,null,function*(){try{let r=X(t,e),n=Y(e),i=ee(e),l=yield Z(t,e);if(!o.isCancelled){let p=yield te(t,e,r,i,n,l,o);for(let F of t.interceptors.response._fns)p=yield F(p);let A=yield ae(p),x=se(p,e.responseHeader),B={url:r,ok:p.ok,status:p.status,statusText:p.statusText,body:x!=null?x:A};oe(e,B),s(B.body)}}catch(r){a(r)}}));var q=class extends y{constructor(e){super(e)}request(e){return N(this.config,e)}};var f=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}organizationGetOrganization(){return this.httpRequest.request({method:"GET",url:"/api/v1/organization/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},E=class{constructor(e){this.httpRequest=e}teamGetTeam(e){return this.httpRequest.request({method:"GET",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamUpdateTeam(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/team/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamDeleteTeam(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",query:{offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamCreateTeam(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/team/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},S=class{constructor(e){this.httpRequest=e}socialAccountConnect(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/connect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountDisconnect(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/social-account/disconnect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountSetChannel(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/set-channel",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountRefreshChannels(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/refresh-channels",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCreatePortalLink(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/create-portal-link",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCopy(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/copy",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},G=class{constructor(e){this.httpRequest=e}uploadGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",query:{teamId:e.teamId,type:e.type,status:e.status},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}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"}})}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"}})}uploadInitLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/init",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadFinalizeLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/finalize",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},v=class{constructor(e){this.httpRequest=e}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:"PATCH",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"}})}postGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{teamId:e.teamId,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"}})}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"}})}},O=class{constructor(e){this.httpRequest=e}analyticsGetSocialAccountAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetSocialAccountAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account/raw",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post/raw",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfileAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePost(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePostByPostId(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawSocialAccountAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawPostsAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},I=class{constructor(e){this.httpRequest=e}commentGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentUpdate(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/comment/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/",query:{teamId:e.teamId,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"}})}commentCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/comment/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},w=class{constructor(e){this.httpRequest=e}miscSetThumbnail(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/thumbnail",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetChannelPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist",query:{teamId:e.teamId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscCreateNewChannelPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscUpdateChannelPlaylist(e={}){return this.httpRequest.request({method:"PUT",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteChannelPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist/{playlistId}",path:{playlistId:e.playlistId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscAddVideoToPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist-items",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetVideosFromPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist-items",query:{teamId:e.teamId,playlistId:e.playlistId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteVideoFromPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist-items/{playlistItemId}",path:{playlistItemId:e.playlistItemId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}};var T=class{constructor(e,s=q){var a,o,r,n,i,l,p,A;this.request=new s({BASE:(a=e==null?void 0:e.BASE)!=null?a:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"1.0.0",WITH_CREDENTIALS:(r=e==null?void 0:e.WITH_CREDENTIALS)!=null?r:!1,CREDENTIALS:(n=e==null?void 0:e.CREDENTIALS)!=null?n:"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:(l=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?l:new u,response:(A=(p=e==null?void 0:e.interceptors)==null?void 0:p.response)!=null?A:new u}}),this.analytics=new O(this.request),this.app=new f(this.request),this.comment=new I(this.request),this.misc=new w(this.request),this.organization=new D(this.request),this.post=new v(this.request),this.socialAccount=new S(this.request),this.team=new E(this.request),this.upload=new G(this.request)}};import re from"crypto";var Ve=["post.published","comment.published","team.created","team.updated","team.deleted","social-account.created","social-account.updated","social-account.deleted"],H=class{constructor(){}verifySignature(e,s,a){return re.createHmac("sha256",a).update(e).digest("hex")===s}constructEvent(e,s,a){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,s,a))throw new Error("Invalid signature");return JSON.parse(o)}},k=class extends T{constructor(s,a){super(R(c({},a),{HEADERS:R(c(c({},U.HEADERS),a==null?void 0:a.HEADERS),{"x-api-key":s})}));this.webhooks=new H}};export{d as ApiError,y as BaseHttpRequest,k as Bundlesocial,b as CancelError,h as CancelablePromise,U as OpenAPI,Ve as webhookEventTypes};
1
+ var V=Object.defineProperty,z=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var M=(t,e,s)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,c=(t,e)=>{for(var s in e||(e={}))$.call(e,s)&&M(t,s,e[s]);if(_)for(var s of _(e))K.call(e,s)&&M(t,s,e[s]);return t},R=(t,e)=>z(t,W(e));var m=(t,e,s)=>new Promise((o,a)=>{var r=l=>{try{i(s.next(l))}catch(p){a(p)}},n=l=>{try{i(s.throw(l))}catch(p){a(p)}},i=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,n);i((s=s.apply(t,e)).next())});var u=class{constructor(){this._fns=[]}eject(e){let s=this._fns.indexOf(e);s!==-1&&(this._fns=[...this._fns.slice(0,s),...this._fns.slice(s+1)])}use(e){this._fns=[...this._fns,e]}},U={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 u,response:new u}};var y=class{constructor(e){this.config=e}};var d=class extends Error{constructor(s,o,a){super(a);this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=s}};var b=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((s,o)=>{this._resolve=s,this._reject=o;let a=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(i))},r=i=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(i))},n=i=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(i)};return Object.defineProperty(n,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(n,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(n,"isCancelled",{get:()=>this._isCancelled}),e(a,r,n)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,s){return this.promise.then(e,s)}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 b("Request aborted"))}}get isCancelled(){return this._isCancelled}};var P=t=>typeof t=="string",g=t=>P(t)&&t!=="",L=t=>t instanceof Blob,j=t=>t instanceof FormData,J=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},Q=t=>{let e=[],s=(a,r)=>{e.push(`${encodeURIComponent(a)}=${encodeURIComponent(String(r))}`)},o=(a,r)=>{r!=null&&(r instanceof Date?s(a,r.toISOString()):Array.isArray(r)?r.forEach(n=>o(a,n)):typeof r=="object"?Object.entries(r).forEach(([n,i])=>o(`${a}[${n}]`,i)):s(a,r))};return Object.entries(t).forEach(([a,r])=>o(a,r)),e.length?`?${e.join("&")}`:""},X=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,o=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(r,n)=>{var i;return(i=e.path)!=null&&i.hasOwnProperty(n)?s(String(e.path[n])):r}),a=t.BASE+o;return e.query?a+Q(e.query):a},Y=t=>{if(t.formData){let e=new FormData,s=(o,a)=>{P(a)||L(a)?e.append(o,a):e.append(o,JSON.stringify(a))};return Object.entries(t.formData).filter(([,o])=>o!=null).forEach(([o,a])=>{Array.isArray(a)?a.forEach(r=>s(o,r)):s(o,a)}),e}},C=(t,e)=>m(void 0,null,function*(){return typeof e=="function"?e(t):e}),Z=(t,e)=>m(void 0,null,function*(){let[s,o,a,r]=yield Promise.all([C(e,t.TOKEN),C(e,t.USERNAME),C(e,t.PASSWORD),C(e,t.HEADERS)]),n=Object.entries(c(c({Accept:"application/json"},r),e.headers)).filter(([,i])=>i!=null).reduce((i,[l,p])=>R(c({},i),{[l]:String(p)}),{});if(g(s)&&(n.Authorization=`Bearer ${s}`),g(o)&&g(a)){let i=J(`${o}:${a}`);n.Authorization=`Basic ${i}`}return e.body!==void 0&&(e.mediaType?n["Content-Type"]=e.mediaType:L(e.body)?n["Content-Type"]=e.body.type||"application/octet-stream":P(e.body)?n["Content-Type"]="text/plain":j(e.body)||(n["Content-Type"]="application/json")),new Headers(n)}),ee=t=>{var e,s;if(t.body!==void 0)return(e=t.mediaType)!=null&&e.includes("application/json")||(s=t.mediaType)!=null&&s.includes("+json")?JSON.stringify(t.body):P(t.body)||L(t.body)||j(t.body)?t.body:JSON.stringify(t.body)},te=(t,e,s,o,a,r,n)=>m(void 0,null,function*(){let i=new AbortController,l={headers:r,body:o!=null?o:a,method:e.method,signal:i.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return n(()=>i.abort()),yield fetch(s,l)}),se=(t,e)=>{if(e){let s=t.headers.get(e);if(P(s))return s}},oe=t=>m(void 0,null,function*(){if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e){let s=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return yield t.json();if(s.some(o=>e.includes(o)))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)}}),ae=(t,e)=>{var a,r;let o=c({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(o)throw new d(t,e,o);if(!e.ok){let n=(a=e.status)!=null?a:"unknown",i=(r=e.statusText)!=null?r:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new d(t,e,`Generic Error: status: ${n}; status text: ${i}; body: ${l}`)}},N=(t,e)=>new h((s,o,a)=>m(void 0,null,function*(){try{let r=X(t,e),n=Y(e),i=ee(e),l=yield Z(t,e);if(!a.isCancelled){let p=yield te(t,e,r,i,n,l,a);for(let F of t.interceptors.response._fns)p=yield F(p);let A=yield oe(p),x=se(p,e.responseHeader),B={url:r,ok:p.ok,status:p.status,statusText:p.statusText,body:x!=null?x:A};ae(e,B),s(B.body)}}catch(r){o(r)}}));var q=class extends y{constructor(e){super(e)}request(e){return N(this.config,e)}};var f=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}organizationGetOrganization(){return this.httpRequest.request({method:"GET",url:"/api/v1/organization/",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},E=class{constructor(e){this.httpRequest=e}teamGetTeam(e){return this.httpRequest.request({method:"GET",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamUpdateTeam(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/team/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamDeleteTeam(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/team/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/team/",query:{offset:e.offset,limit:e.limit},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}teamCreateTeam(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/team/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},S=class{constructor(e){this.httpRequest=e}socialAccountConnect(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/connect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountDisconnect(e={}){return this.httpRequest.request({method:"DELETE",url:"/api/v1/social-account/disconnect",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountSetChannel(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/set-channel",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountRefreshChannels(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/refresh-channels",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCreatePortalLink(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/create-portal-link",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}socialAccountCopy(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/social-account/copy",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},G=class{constructor(e){this.httpRequest=e}uploadGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",query:{teamId:e.teamId,type:e.type,status:e.status},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}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"}})}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"}})}uploadInitLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/init",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}uploadFinalizeLargeUpload(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/upload/finalize",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},v=class{constructor(e){this.httpRequest=e}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:"PATCH",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"}})}postGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/post/",query:{teamId:e.teamId,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"}})}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"}})}},O=class{constructor(e){this.httpRequest=e}analyticsGetSocialAccountAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetSocialAccountAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/social-account/raw",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetPostAnalyticsRaw(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/post/raw",query:{postId:e.postId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfileAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePost(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePostByPostId(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post/post/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawSocialAccountAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-profile",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetRawPostsAnalytics(){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/raw-post",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},I=class{constructor(e){this.httpRequest=e}commentGet(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentUpdate(e){return this.httpRequest.request({method:"PATCH",url:"/api/v1/comment/{id}",path:{id:e.id},body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentDelete(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/comment/{id}",path:{id:e.id},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}commentGetList(e){return this.httpRequest.request({method:"GET",url:"/api/v1/comment/",query:{teamId:e.teamId,postId:e.postId,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"}})}commentCreate(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/comment/",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}},w=class{constructor(e){this.httpRequest=e}miscSetThumbnail(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/thumbnail",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetChannelPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist",query:{teamId:e.teamId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscCreateNewChannelPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscUpdateChannelPlaylist(e={}){return this.httpRequest.request({method:"PUT",url:"/api/v1/misc/youtube/playlist",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteChannelPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist/{playlistId}",path:{playlistId:e.playlistId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscAddVideoToPlaylist(e={}){return this.httpRequest.request({method:"POST",url:"/api/v1/misc/youtube/playlist-items",body:e.requestBody,mediaType:"application/json",errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscGetVideosFromPlaylist(e){return this.httpRequest.request({method:"GET",url:"/api/v1/misc/youtube/playlist-items",query:{teamId:e.teamId,playlistId:e.playlistId,maxResults:e.maxResults},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}miscDeleteVideoFromPlaylist(e){return this.httpRequest.request({method:"DELETE",url:"/api/v1/misc/youtube/playlist-items/{playlistItemId}",path:{playlistItemId:e.playlistItemId},query:{teamId:e.teamId},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}};var T=class{constructor(e,s=q){var o,a,r,n,i,l,p,A;this.request=new s({BASE:(o=e==null?void 0:e.BASE)!=null?o:"https://api.bundle.social",VERSION:(a=e==null?void 0:e.VERSION)!=null?a:"1.0.0",WITH_CREDENTIALS:(r=e==null?void 0:e.WITH_CREDENTIALS)!=null?r:!1,CREDENTIALS:(n=e==null?void 0:e.CREDENTIALS)!=null?n:"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:(l=(i=e==null?void 0:e.interceptors)==null?void 0:i.request)!=null?l:new u,response:(A=(p=e==null?void 0:e.interceptors)==null?void 0:p.response)!=null?A:new u}}),this.analytics=new O(this.request),this.app=new f(this.request),this.comment=new I(this.request),this.misc=new w(this.request),this.organization=new D(this.request),this.post=new v(this.request),this.socialAccount=new S(this.request),this.team=new E(this.request),this.upload=new G(this.request)}};import re from"crypto";var Ve=["post.published","comment.published","team.created","team.updated","team.deleted","social-account.created","social-account.updated","social-account.deleted"],H=class{constructor(){}verifySignature(e,s,o){return re.createHmac("sha256",o).update(e).digest("hex")===s}constructEvent(e,s,o){let a=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(a,s,o))throw new Error("Invalid signature");return JSON.parse(a)}},k=class extends T{constructor(s,o){super(R(c({},o),{HEADERS:R(c(c({},U.HEADERS),o==null?void 0:o.HEADERS),{"x-api-key":s})}));this.webhooks=new H}};export{d as ApiError,y as BaseHttpRequest,k as Bundlesocial,b as CancelError,h as CancelablePromise,U as OpenAPI,Ve as webhookEventTypes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bundlesocial",
3
- "version": "2.18.0",
3
+ "version": "2.20.0",
4
4
  "description": "Node.js library for the bundle.social API",
5
5
  "keywords": [
6
6
  "bundle.social",