bundlesocial 2.13.0 → 2.14.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
@@ -386,6 +386,133 @@ type TeamDeleteTeamResponse = {
386
386
  updatedAt: string | null;
387
387
  deletedAt?: string | null;
388
388
  };
389
+ type TeamGetListData = {
390
+ limit?: number | null;
391
+ offset?: number | null;
392
+ };
393
+ type TeamGetListResponse = {
394
+ items: Array<{
395
+ id: string;
396
+ name: string;
397
+ avatarUrl?: string | null;
398
+ organizationId: string;
399
+ createdById: string;
400
+ createdAt: string | null;
401
+ updatedAt: string | null;
402
+ deletedAt?: string | null;
403
+ organization: {
404
+ id: string;
405
+ createdById: string;
406
+ promotionCodeId?: string | null;
407
+ name?: string | null;
408
+ avatarUrl?: string | null;
409
+ apiAccess?: boolean;
410
+ ref?: string | null;
411
+ dailyPostLimit?: {
412
+ TWITTER?: number;
413
+ FACEBOOK?: number;
414
+ INSTAGRAM?: number;
415
+ LINKEDIN?: number;
416
+ YOUTUBE?: number;
417
+ TIKTOK?: number;
418
+ THREADS?: number;
419
+ PINTEREST?: number;
420
+ REDDIT?: number;
421
+ DISCORD?: number;
422
+ SLACK?: number;
423
+ MASTODON?: number;
424
+ } | null;
425
+ createdAt: string | null;
426
+ updatedAt: string | null;
427
+ deletedAt?: string | null;
428
+ };
429
+ createdBy: {
430
+ id: string;
431
+ externalId: string;
432
+ email: string;
433
+ emailVerified?: string | null;
434
+ firstName?: string | null;
435
+ lastName?: string | null;
436
+ avatarUrl?: string | null;
437
+ role: 'ADMIN' | 'CUSTOMER';
438
+ createdAt: string | null;
439
+ updatedAt: string | null;
440
+ deletedAt?: string | null;
441
+ };
442
+ bots: Array<{
443
+ id: string;
444
+ name: string;
445
+ avatarUrl?: string | null;
446
+ teamId: string;
447
+ createdAt: string | null;
448
+ updatedAt: string | null;
449
+ deletedAt?: string | null;
450
+ }>;
451
+ socialAccounts: Array<{
452
+ id: string;
453
+ type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
454
+ teamId: string;
455
+ username?: string | null;
456
+ displayName?: string | null;
457
+ externalId?: string | null;
458
+ userUsername?: string | null;
459
+ userDisplayName?: string | null;
460
+ userId?: string | null;
461
+ channels?: Array<{
462
+ id: string;
463
+ name?: string | null;
464
+ username?: string | null;
465
+ webhook?: {
466
+ id?: string | null;
467
+ name?: string | null;
468
+ avatar?: string | null;
469
+ url?: string | null;
470
+ } | null;
471
+ }> | null;
472
+ createdAt: string | null;
473
+ updatedAt: string | null;
474
+ deletedAt?: string | null;
475
+ }>;
476
+ bio?: {
477
+ id: string;
478
+ username: string;
479
+ name: string | null;
480
+ description: string | null;
481
+ avatarUrl: string | null;
482
+ socials: {
483
+ [key: string]: (string | null);
484
+ } | null;
485
+ teamId: string;
486
+ createdAt: string | null;
487
+ updatedAt: string | null;
488
+ items: Array<{
489
+ id: string;
490
+ bioId: string;
491
+ name: string;
492
+ link: string;
493
+ icon?: string | null;
494
+ enabled: boolean;
495
+ order?: number | null;
496
+ createdAt: string | null;
497
+ updatedAt: string | null;
498
+ analytics: Array<{
499
+ id: string;
500
+ count: number;
501
+ bioItemId: string;
502
+ deviceType: {
503
+ [key: string]: (number);
504
+ };
505
+ country: {
506
+ [key: string]: (number);
507
+ };
508
+ createdAt: string | null;
509
+ updatedAt: string | null;
510
+ }>;
511
+ }>;
512
+ } | null;
513
+ }>;
514
+ total: number;
515
+ };
389
516
  type TeamCreateTeamData = {
390
517
  /**
391
518
  * Body
@@ -585,6 +712,7 @@ type SocialAccountCopyResponse = Array<{
585
712
  deletedAt?: string | null;
586
713
  }>;
587
714
  type UploadGetListData = {
715
+ status?: 'USED' | 'UNUSED' | null;
588
716
  teamId?: string | null;
589
717
  type?: 'image' | 'video' | null;
590
718
  };
@@ -608,6 +736,13 @@ type UploadGetListResponse = Array<{
608
736
  ext?: string | null;
609
737
  createdAt: string | null;
610
738
  updatedAt: string | null;
739
+ posts: Array<{
740
+ postId: string;
741
+ uploadId: string;
742
+ createdAt: string | null;
743
+ updatedAt: string | null;
744
+ deletedAt?: string | null;
745
+ }>;
611
746
  }>;
612
747
  type UploadCreateData = {
613
748
  /**
@@ -691,6 +826,13 @@ type UploadGetResponse = {
691
826
  ext?: string | null;
692
827
  createdAt: string | null;
693
828
  updatedAt: string | null;
829
+ posts: Array<{
830
+ postId: string;
831
+ uploadId: string;
832
+ createdAt: string | null;
833
+ updatedAt: string | null;
834
+ deletedAt?: string | null;
835
+ }>;
694
836
  };
695
837
  type UploadDeleteData = {
696
838
  id: string;
@@ -770,7 +912,7 @@ type PostGetResponse = {
770
912
  title: string;
771
913
  postDate: string | null;
772
914
  postedDate?: string | null;
773
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
915
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
774
916
  data: {
775
917
  TWITTER?: {
776
918
  text?: string | null;
@@ -1321,7 +1463,7 @@ type PostUpdateResponse = {
1321
1463
  title: string;
1322
1464
  postDate: string | null;
1323
1465
  postedDate?: string | null;
1324
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
1466
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
1325
1467
  data: {
1326
1468
  TWITTER?: {
1327
1469
  text?: string | null;
@@ -1608,7 +1750,7 @@ type PostDeleteResponse = {
1608
1750
  title: string;
1609
1751
  postDate: string | null;
1610
1752
  postedDate?: string | null;
1611
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
1753
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
1612
1754
  data: {
1613
1755
  TWITTER?: {
1614
1756
  text?: string | null;
@@ -1892,7 +2034,7 @@ type PostGetListData = {
1892
2034
  orderBy?: 'createdAt' | 'updatedAt' | 'postDate' | 'postedDate' | 'deletedAt' | null;
1893
2035
  platforms?: Array<('TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK')> | null;
1894
2036
  q?: string | null;
1895
- status?: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | null;
2037
+ status?: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW' | null;
1896
2038
  teamId: string;
1897
2039
  };
1898
2040
  type PostGetListResponse = {
@@ -1903,7 +2045,7 @@ type PostGetListResponse = {
1903
2045
  title: string;
1904
2046
  postDate: string | null;
1905
2047
  postedDate?: string | null;
1906
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
2048
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
1907
2049
  data: {
1908
2050
  TWITTER?: {
1909
2051
  text?: string | null;
@@ -2456,7 +2598,7 @@ type PostCreateResponse = {
2456
2598
  title: string;
2457
2599
  postDate: string | null;
2458
2600
  postedDate?: string | null;
2459
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
2601
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
2460
2602
  data: {
2461
2603
  TWITTER?: {
2462
2604
  text?: string | null;
@@ -2845,7 +2987,7 @@ type AnalyticsGetProfilePostResponse = {
2845
2987
  title: string;
2846
2988
  postDate: string | null;
2847
2989
  postedDate?: string | null;
2848
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
2990
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
2849
2991
  data: {
2850
2992
  TWITTER?: {
2851
2993
  text?: string | null;
@@ -4332,6 +4474,177 @@ type $OpenApiTs = {
4332
4474
  };
4333
4475
  };
4334
4476
  '/api/v1/team/': {
4477
+ get: {
4478
+ req: TeamGetListData;
4479
+ res: {
4480
+ /**
4481
+ * 200
4482
+ */
4483
+ 200: {
4484
+ items: Array<{
4485
+ id: string;
4486
+ name: string;
4487
+ avatarUrl?: string | null;
4488
+ organizationId: string;
4489
+ createdById: string;
4490
+ createdAt: string | null;
4491
+ updatedAt: string | null;
4492
+ deletedAt?: string | null;
4493
+ organization: {
4494
+ id: string;
4495
+ createdById: string;
4496
+ promotionCodeId?: string | null;
4497
+ name?: string | null;
4498
+ avatarUrl?: string | null;
4499
+ apiAccess?: boolean;
4500
+ ref?: string | null;
4501
+ dailyPostLimit?: {
4502
+ TWITTER?: number;
4503
+ FACEBOOK?: number;
4504
+ INSTAGRAM?: number;
4505
+ LINKEDIN?: number;
4506
+ YOUTUBE?: number;
4507
+ TIKTOK?: number;
4508
+ THREADS?: number;
4509
+ PINTEREST?: number;
4510
+ REDDIT?: number;
4511
+ DISCORD?: number;
4512
+ SLACK?: number;
4513
+ MASTODON?: number;
4514
+ } | null;
4515
+ createdAt: string | null;
4516
+ updatedAt: string | null;
4517
+ deletedAt?: string | null;
4518
+ };
4519
+ createdBy: {
4520
+ id: string;
4521
+ externalId: string;
4522
+ email: string;
4523
+ emailVerified?: string | null;
4524
+ firstName?: string | null;
4525
+ lastName?: string | null;
4526
+ avatarUrl?: string | null;
4527
+ role: 'ADMIN' | 'CUSTOMER';
4528
+ createdAt: string | null;
4529
+ updatedAt: string | null;
4530
+ deletedAt?: string | null;
4531
+ };
4532
+ bots: Array<{
4533
+ id: string;
4534
+ name: string;
4535
+ avatarUrl?: string | null;
4536
+ teamId: string;
4537
+ createdAt: string | null;
4538
+ updatedAt: string | null;
4539
+ deletedAt?: string | null;
4540
+ }>;
4541
+ socialAccounts: Array<{
4542
+ id: string;
4543
+ type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
4544
+ teamId: string;
4545
+ username?: string | null;
4546
+ displayName?: string | null;
4547
+ externalId?: string | null;
4548
+ userUsername?: string | null;
4549
+ userDisplayName?: string | null;
4550
+ userId?: string | null;
4551
+ channels?: Array<{
4552
+ id: string;
4553
+ name?: string | null;
4554
+ username?: string | null;
4555
+ webhook?: {
4556
+ id?: string | null;
4557
+ name?: string | null;
4558
+ avatar?: string | null;
4559
+ url?: string | null;
4560
+ } | null;
4561
+ }> | null;
4562
+ createdAt: string | null;
4563
+ updatedAt: string | null;
4564
+ deletedAt?: string | null;
4565
+ }>;
4566
+ bio?: {
4567
+ id: string;
4568
+ username: string;
4569
+ name: string | null;
4570
+ description: string | null;
4571
+ avatarUrl: string | null;
4572
+ socials: {
4573
+ [key: string]: (string | null);
4574
+ } | null;
4575
+ teamId: string;
4576
+ createdAt: string | null;
4577
+ updatedAt: string | null;
4578
+ items: Array<{
4579
+ id: string;
4580
+ bioId: string;
4581
+ name: string;
4582
+ link: string;
4583
+ icon?: string | null;
4584
+ enabled: boolean;
4585
+ order?: number | null;
4586
+ createdAt: string | null;
4587
+ updatedAt: string | null;
4588
+ analytics: Array<{
4589
+ id: string;
4590
+ count: number;
4591
+ bioItemId: string;
4592
+ deviceType: {
4593
+ [key: string]: (number);
4594
+ };
4595
+ country: {
4596
+ [key: string]: (number);
4597
+ };
4598
+ createdAt: string | null;
4599
+ updatedAt: string | null;
4600
+ }>;
4601
+ }>;
4602
+ } | null;
4603
+ }>;
4604
+ total: number;
4605
+ };
4606
+ /**
4607
+ * 400
4608
+ */
4609
+ 400: {
4610
+ message: string;
4611
+ issues?: Array<{
4612
+ message: string;
4613
+ path?: Array<(string | number)> | null;
4614
+ }> | null;
4615
+ };
4616
+ /**
4617
+ * 401
4618
+ */
4619
+ 401: {
4620
+ message: string;
4621
+ };
4622
+ /**
4623
+ * 403
4624
+ */
4625
+ 403: {
4626
+ message: string;
4627
+ };
4628
+ /**
4629
+ * 404
4630
+ */
4631
+ 404: {
4632
+ message: string;
4633
+ };
4634
+ /**
4635
+ * 429
4636
+ */
4637
+ 429: {
4638
+ message: string;
4639
+ };
4640
+ /**
4641
+ * 500
4642
+ */
4643
+ 500: {
4644
+ message: string;
4645
+ };
4646
+ };
4647
+ };
4335
4648
  post: {
4336
4649
  req: TeamCreateTeamData;
4337
4650
  res: {
@@ -4827,6 +5140,13 @@ type $OpenApiTs = {
4827
5140
  ext?: string | null;
4828
5141
  createdAt: string | null;
4829
5142
  updatedAt: string | null;
5143
+ posts: Array<{
5144
+ postId: string;
5145
+ uploadId: string;
5146
+ createdAt: string | null;
5147
+ updatedAt: string | null;
5148
+ deletedAt?: string | null;
5149
+ }>;
4830
5150
  }>;
4831
5151
  /**
4832
5152
  * 400
@@ -5036,6 +5356,13 @@ type $OpenApiTs = {
5036
5356
  ext?: string | null;
5037
5357
  createdAt: string | null;
5038
5358
  updatedAt: string | null;
5359
+ posts: Array<{
5360
+ postId: string;
5361
+ uploadId: string;
5362
+ createdAt: string | null;
5363
+ updatedAt: string | null;
5364
+ deletedAt?: string | null;
5365
+ }>;
5039
5366
  };
5040
5367
  /**
5041
5368
  * 400
@@ -5288,7 +5615,7 @@ type $OpenApiTs = {
5288
5615
  title: string;
5289
5616
  postDate: string | null;
5290
5617
  postedDate?: string | null;
5291
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
5618
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
5292
5619
  data: {
5293
5620
  TWITTER?: {
5294
5621
  text?: string | null;
@@ -5680,7 +6007,7 @@ type $OpenApiTs = {
5680
6007
  title: string;
5681
6008
  postDate: string | null;
5682
6009
  postedDate?: string | null;
5683
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
6010
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
5684
6011
  data: {
5685
6012
  TWITTER?: {
5686
6013
  text?: string | null;
@@ -6012,7 +6339,7 @@ type $OpenApiTs = {
6012
6339
  title: string;
6013
6340
  postDate: string | null;
6014
6341
  postedDate?: string | null;
6015
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
6342
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
6016
6343
  data: {
6017
6344
  TWITTER?: {
6018
6345
  text?: string | null;
@@ -6347,7 +6674,7 @@ type $OpenApiTs = {
6347
6674
  title: string;
6348
6675
  postDate: string | null;
6349
6676
  postedDate?: string | null;
6350
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
6677
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
6351
6678
  data: {
6352
6679
  TWITTER?: {
6353
6680
  text?: string | null;
@@ -6741,7 +7068,7 @@ type $OpenApiTs = {
6741
7068
  title: string;
6742
7069
  postDate: string | null;
6743
7070
  postedDate?: string | null;
6744
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
7071
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
6745
7072
  data: {
6746
7073
  TWITTER?: {
6747
7074
  text?: string | null;
@@ -7269,7 +7596,7 @@ type $OpenApiTs = {
7269
7596
  title: string;
7270
7597
  postDate: string | null;
7271
7598
  postedDate?: string | null;
7272
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
7599
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
7273
7600
  data: {
7274
7601
  TWITTER?: {
7275
7602
  text?: string | null;
@@ -8440,6 +8767,15 @@ declare class TeamService {
8440
8767
  * @throws ApiError
8441
8768
  */
8442
8769
  teamDeleteTeam(data: TeamDeleteTeamData): CancelablePromise<TeamDeleteTeamResponse>;
8770
+ /**
8771
+ * Get list of teams
8772
+ * @param data The data for the request.
8773
+ * @param data.offset
8774
+ * @param data.limit
8775
+ * @returns unknown 200
8776
+ * @throws ApiError
8777
+ */
8778
+ teamGetList(data?: TeamGetListData): CancelablePromise<TeamGetListResponse>;
8443
8779
  /**
8444
8780
  * Create new team
8445
8781
  * @param data The data for the request.
@@ -8514,6 +8850,7 @@ declare class UploadService {
8514
8850
  * @param data The data for the request.
8515
8851
  * @param data.teamId
8516
8852
  * @param data.type
8853
+ * @param data.status
8517
8854
  * @returns unknown 200
8518
8855
  * @throws ApiError
8519
8856
  */
@@ -8778,4 +9115,4 @@ declare class Bundlesocial extends Client {
8778
9115
  constructor(apiKey: string, options?: OpenAPIConfig);
8779
9116
  }
8780
9117
 
8781
- export { $OpenApiTs, AnalyticsGetProfileAnalyticsData, AnalyticsGetProfileAnalyticsResponse, AnalyticsGetProfilePostData, AnalyticsGetProfilePostResponse, AnalyticsGetProfilePostsData, AnalyticsGetProfilePostsResponse, ApiError, AppGetHealthResponse, BaseHttpRequest, Bundlesocial, CancelError, CancelablePromise, CommentCreateData, CommentCreateResponse, CommentDeleteData, CommentDeleteResponse, CommentGetData, CommentGetListData, CommentGetListResponse, CommentGetResponse, CommentUpdateData, CommentUpdateResponse, OpenAPI, OpenAPIConfig, OrganizationGetOrganizationResponse, PostCreateData, PostCreateResponse, PostDeleteData, PostDeleteResponse, PostGetData, PostGetListData, PostGetListResponse, PostGetResponse, PostUpdateData, PostUpdateResponse, SocialAccountConnectData, SocialAccountConnectResponse, SocialAccountCopyData, SocialAccountCopyResponse, SocialAccountCreatePortalLinkData, SocialAccountCreatePortalLinkResponse, SocialAccountDisconnectData, SocialAccountDisconnectResponse, SocialAccountRefreshChannelsData, SocialAccountRefreshChannelsResponse, SocialAccountSetChannelData, SocialAccountSetChannelResponse, TeamCreateTeamData, TeamCreateTeamResponse, TeamDeleteTeamData, TeamDeleteTeamResponse, TeamGetTeamData, TeamGetTeamResponse, TeamUpdateTeamData, TeamUpdateTeamResponse, UploadCreateData, UploadCreateResponse, UploadDeleteData, UploadDeleteManyData, UploadDeleteManyResponse, UploadDeleteResponse, UploadFinalizeLargeUploadData, UploadFinalizeLargeUploadResponse, UploadGetData, UploadGetListData, UploadGetListResponse, UploadGetResponse, UploadInitLargeUploadData, UploadInitLargeUploadResponse, WebhookEvent, WebhookEventType, webhookEventTypes };
9118
+ export { $OpenApiTs, AnalyticsGetProfileAnalyticsData, AnalyticsGetProfileAnalyticsResponse, AnalyticsGetProfilePostData, AnalyticsGetProfilePostResponse, AnalyticsGetProfilePostsData, AnalyticsGetProfilePostsResponse, ApiError, AppGetHealthResponse, BaseHttpRequest, Bundlesocial, CancelError, CancelablePromise, CommentCreateData, CommentCreateResponse, CommentDeleteData, CommentDeleteResponse, CommentGetData, CommentGetListData, CommentGetListResponse, CommentGetResponse, CommentUpdateData, CommentUpdateResponse, OpenAPI, OpenAPIConfig, OrganizationGetOrganizationResponse, PostCreateData, PostCreateResponse, PostDeleteData, PostDeleteResponse, PostGetData, PostGetListData, PostGetListResponse, PostGetResponse, PostUpdateData, PostUpdateResponse, SocialAccountConnectData, SocialAccountConnectResponse, SocialAccountCopyData, SocialAccountCopyResponse, SocialAccountCreatePortalLinkData, SocialAccountCreatePortalLinkResponse, SocialAccountDisconnectData, SocialAccountDisconnectResponse, SocialAccountRefreshChannelsData, SocialAccountRefreshChannelsResponse, SocialAccountSetChannelData, SocialAccountSetChannelResponse, TeamCreateTeamData, TeamCreateTeamResponse, TeamDeleteTeamData, TeamDeleteTeamResponse, TeamGetListData, TeamGetListResponse, TeamGetTeamData, TeamGetTeamResponse, TeamUpdateTeamData, TeamUpdateTeamResponse, UploadCreateData, UploadCreateResponse, UploadDeleteData, UploadDeleteManyData, UploadDeleteManyResponse, UploadDeleteResponse, UploadFinalizeLargeUploadData, UploadFinalizeLargeUploadResponse, UploadGetData, UploadGetListData, UploadGetListResponse, UploadGetResponse, UploadInitLargeUploadData, UploadInitLargeUploadResponse, WebhookEvent, WebhookEventType, webhookEventTypes };
package/dist/index.d.ts CHANGED
@@ -386,6 +386,133 @@ type TeamDeleteTeamResponse = {
386
386
  updatedAt: string | null;
387
387
  deletedAt?: string | null;
388
388
  };
389
+ type TeamGetListData = {
390
+ limit?: number | null;
391
+ offset?: number | null;
392
+ };
393
+ type TeamGetListResponse = {
394
+ items: Array<{
395
+ id: string;
396
+ name: string;
397
+ avatarUrl?: string | null;
398
+ organizationId: string;
399
+ createdById: string;
400
+ createdAt: string | null;
401
+ updatedAt: string | null;
402
+ deletedAt?: string | null;
403
+ organization: {
404
+ id: string;
405
+ createdById: string;
406
+ promotionCodeId?: string | null;
407
+ name?: string | null;
408
+ avatarUrl?: string | null;
409
+ apiAccess?: boolean;
410
+ ref?: string | null;
411
+ dailyPostLimit?: {
412
+ TWITTER?: number;
413
+ FACEBOOK?: number;
414
+ INSTAGRAM?: number;
415
+ LINKEDIN?: number;
416
+ YOUTUBE?: number;
417
+ TIKTOK?: number;
418
+ THREADS?: number;
419
+ PINTEREST?: number;
420
+ REDDIT?: number;
421
+ DISCORD?: number;
422
+ SLACK?: number;
423
+ MASTODON?: number;
424
+ } | null;
425
+ createdAt: string | null;
426
+ updatedAt: string | null;
427
+ deletedAt?: string | null;
428
+ };
429
+ createdBy: {
430
+ id: string;
431
+ externalId: string;
432
+ email: string;
433
+ emailVerified?: string | null;
434
+ firstName?: string | null;
435
+ lastName?: string | null;
436
+ avatarUrl?: string | null;
437
+ role: 'ADMIN' | 'CUSTOMER';
438
+ createdAt: string | null;
439
+ updatedAt: string | null;
440
+ deletedAt?: string | null;
441
+ };
442
+ bots: Array<{
443
+ id: string;
444
+ name: string;
445
+ avatarUrl?: string | null;
446
+ teamId: string;
447
+ createdAt: string | null;
448
+ updatedAt: string | null;
449
+ deletedAt?: string | null;
450
+ }>;
451
+ socialAccounts: Array<{
452
+ id: string;
453
+ type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
454
+ teamId: string;
455
+ username?: string | null;
456
+ displayName?: string | null;
457
+ externalId?: string | null;
458
+ userUsername?: string | null;
459
+ userDisplayName?: string | null;
460
+ userId?: string | null;
461
+ channels?: Array<{
462
+ id: string;
463
+ name?: string | null;
464
+ username?: string | null;
465
+ webhook?: {
466
+ id?: string | null;
467
+ name?: string | null;
468
+ avatar?: string | null;
469
+ url?: string | null;
470
+ } | null;
471
+ }> | null;
472
+ createdAt: string | null;
473
+ updatedAt: string | null;
474
+ deletedAt?: string | null;
475
+ }>;
476
+ bio?: {
477
+ id: string;
478
+ username: string;
479
+ name: string | null;
480
+ description: string | null;
481
+ avatarUrl: string | null;
482
+ socials: {
483
+ [key: string]: (string | null);
484
+ } | null;
485
+ teamId: string;
486
+ createdAt: string | null;
487
+ updatedAt: string | null;
488
+ items: Array<{
489
+ id: string;
490
+ bioId: string;
491
+ name: string;
492
+ link: string;
493
+ icon?: string | null;
494
+ enabled: boolean;
495
+ order?: number | null;
496
+ createdAt: string | null;
497
+ updatedAt: string | null;
498
+ analytics: Array<{
499
+ id: string;
500
+ count: number;
501
+ bioItemId: string;
502
+ deviceType: {
503
+ [key: string]: (number);
504
+ };
505
+ country: {
506
+ [key: string]: (number);
507
+ };
508
+ createdAt: string | null;
509
+ updatedAt: string | null;
510
+ }>;
511
+ }>;
512
+ } | null;
513
+ }>;
514
+ total: number;
515
+ };
389
516
  type TeamCreateTeamData = {
390
517
  /**
391
518
  * Body
@@ -585,6 +712,7 @@ type SocialAccountCopyResponse = Array<{
585
712
  deletedAt?: string | null;
586
713
  }>;
587
714
  type UploadGetListData = {
715
+ status?: 'USED' | 'UNUSED' | null;
588
716
  teamId?: string | null;
589
717
  type?: 'image' | 'video' | null;
590
718
  };
@@ -608,6 +736,13 @@ type UploadGetListResponse = Array<{
608
736
  ext?: string | null;
609
737
  createdAt: string | null;
610
738
  updatedAt: string | null;
739
+ posts: Array<{
740
+ postId: string;
741
+ uploadId: string;
742
+ createdAt: string | null;
743
+ updatedAt: string | null;
744
+ deletedAt?: string | null;
745
+ }>;
611
746
  }>;
612
747
  type UploadCreateData = {
613
748
  /**
@@ -691,6 +826,13 @@ type UploadGetResponse = {
691
826
  ext?: string | null;
692
827
  createdAt: string | null;
693
828
  updatedAt: string | null;
829
+ posts: Array<{
830
+ postId: string;
831
+ uploadId: string;
832
+ createdAt: string | null;
833
+ updatedAt: string | null;
834
+ deletedAt?: string | null;
835
+ }>;
694
836
  };
695
837
  type UploadDeleteData = {
696
838
  id: string;
@@ -770,7 +912,7 @@ type PostGetResponse = {
770
912
  title: string;
771
913
  postDate: string | null;
772
914
  postedDate?: string | null;
773
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
915
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
774
916
  data: {
775
917
  TWITTER?: {
776
918
  text?: string | null;
@@ -1321,7 +1463,7 @@ type PostUpdateResponse = {
1321
1463
  title: string;
1322
1464
  postDate: string | null;
1323
1465
  postedDate?: string | null;
1324
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
1466
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
1325
1467
  data: {
1326
1468
  TWITTER?: {
1327
1469
  text?: string | null;
@@ -1608,7 +1750,7 @@ type PostDeleteResponse = {
1608
1750
  title: string;
1609
1751
  postDate: string | null;
1610
1752
  postedDate?: string | null;
1611
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
1753
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
1612
1754
  data: {
1613
1755
  TWITTER?: {
1614
1756
  text?: string | null;
@@ -1892,7 +2034,7 @@ type PostGetListData = {
1892
2034
  orderBy?: 'createdAt' | 'updatedAt' | 'postDate' | 'postedDate' | 'deletedAt' | null;
1893
2035
  platforms?: Array<('TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK')> | null;
1894
2036
  q?: string | null;
1895
- status?: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | null;
2037
+ status?: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW' | null;
1896
2038
  teamId: string;
1897
2039
  };
1898
2040
  type PostGetListResponse = {
@@ -1903,7 +2045,7 @@ type PostGetListResponse = {
1903
2045
  title: string;
1904
2046
  postDate: string | null;
1905
2047
  postedDate?: string | null;
1906
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
2048
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
1907
2049
  data: {
1908
2050
  TWITTER?: {
1909
2051
  text?: string | null;
@@ -2456,7 +2598,7 @@ type PostCreateResponse = {
2456
2598
  title: string;
2457
2599
  postDate: string | null;
2458
2600
  postedDate?: string | null;
2459
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
2601
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
2460
2602
  data: {
2461
2603
  TWITTER?: {
2462
2604
  text?: string | null;
@@ -2845,7 +2987,7 @@ type AnalyticsGetProfilePostResponse = {
2845
2987
  title: string;
2846
2988
  postDate: string | null;
2847
2989
  postedDate?: string | null;
2848
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
2990
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
2849
2991
  data: {
2850
2992
  TWITTER?: {
2851
2993
  text?: string | null;
@@ -4332,6 +4474,177 @@ type $OpenApiTs = {
4332
4474
  };
4333
4475
  };
4334
4476
  '/api/v1/team/': {
4477
+ get: {
4478
+ req: TeamGetListData;
4479
+ res: {
4480
+ /**
4481
+ * 200
4482
+ */
4483
+ 200: {
4484
+ items: Array<{
4485
+ id: string;
4486
+ name: string;
4487
+ avatarUrl?: string | null;
4488
+ organizationId: string;
4489
+ createdById: string;
4490
+ createdAt: string | null;
4491
+ updatedAt: string | null;
4492
+ deletedAt?: string | null;
4493
+ organization: {
4494
+ id: string;
4495
+ createdById: string;
4496
+ promotionCodeId?: string | null;
4497
+ name?: string | null;
4498
+ avatarUrl?: string | null;
4499
+ apiAccess?: boolean;
4500
+ ref?: string | null;
4501
+ dailyPostLimit?: {
4502
+ TWITTER?: number;
4503
+ FACEBOOK?: number;
4504
+ INSTAGRAM?: number;
4505
+ LINKEDIN?: number;
4506
+ YOUTUBE?: number;
4507
+ TIKTOK?: number;
4508
+ THREADS?: number;
4509
+ PINTEREST?: number;
4510
+ REDDIT?: number;
4511
+ DISCORD?: number;
4512
+ SLACK?: number;
4513
+ MASTODON?: number;
4514
+ } | null;
4515
+ createdAt: string | null;
4516
+ updatedAt: string | null;
4517
+ deletedAt?: string | null;
4518
+ };
4519
+ createdBy: {
4520
+ id: string;
4521
+ externalId: string;
4522
+ email: string;
4523
+ emailVerified?: string | null;
4524
+ firstName?: string | null;
4525
+ lastName?: string | null;
4526
+ avatarUrl?: string | null;
4527
+ role: 'ADMIN' | 'CUSTOMER';
4528
+ createdAt: string | null;
4529
+ updatedAt: string | null;
4530
+ deletedAt?: string | null;
4531
+ };
4532
+ bots: Array<{
4533
+ id: string;
4534
+ name: string;
4535
+ avatarUrl?: string | null;
4536
+ teamId: string;
4537
+ createdAt: string | null;
4538
+ updatedAt: string | null;
4539
+ deletedAt?: string | null;
4540
+ }>;
4541
+ socialAccounts: Array<{
4542
+ id: string;
4543
+ type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
4544
+ teamId: string;
4545
+ username?: string | null;
4546
+ displayName?: string | null;
4547
+ externalId?: string | null;
4548
+ userUsername?: string | null;
4549
+ userDisplayName?: string | null;
4550
+ userId?: string | null;
4551
+ channels?: Array<{
4552
+ id: string;
4553
+ name?: string | null;
4554
+ username?: string | null;
4555
+ webhook?: {
4556
+ id?: string | null;
4557
+ name?: string | null;
4558
+ avatar?: string | null;
4559
+ url?: string | null;
4560
+ } | null;
4561
+ }> | null;
4562
+ createdAt: string | null;
4563
+ updatedAt: string | null;
4564
+ deletedAt?: string | null;
4565
+ }>;
4566
+ bio?: {
4567
+ id: string;
4568
+ username: string;
4569
+ name: string | null;
4570
+ description: string | null;
4571
+ avatarUrl: string | null;
4572
+ socials: {
4573
+ [key: string]: (string | null);
4574
+ } | null;
4575
+ teamId: string;
4576
+ createdAt: string | null;
4577
+ updatedAt: string | null;
4578
+ items: Array<{
4579
+ id: string;
4580
+ bioId: string;
4581
+ name: string;
4582
+ link: string;
4583
+ icon?: string | null;
4584
+ enabled: boolean;
4585
+ order?: number | null;
4586
+ createdAt: string | null;
4587
+ updatedAt: string | null;
4588
+ analytics: Array<{
4589
+ id: string;
4590
+ count: number;
4591
+ bioItemId: string;
4592
+ deviceType: {
4593
+ [key: string]: (number);
4594
+ };
4595
+ country: {
4596
+ [key: string]: (number);
4597
+ };
4598
+ createdAt: string | null;
4599
+ updatedAt: string | null;
4600
+ }>;
4601
+ }>;
4602
+ } | null;
4603
+ }>;
4604
+ total: number;
4605
+ };
4606
+ /**
4607
+ * 400
4608
+ */
4609
+ 400: {
4610
+ message: string;
4611
+ issues?: Array<{
4612
+ message: string;
4613
+ path?: Array<(string | number)> | null;
4614
+ }> | null;
4615
+ };
4616
+ /**
4617
+ * 401
4618
+ */
4619
+ 401: {
4620
+ message: string;
4621
+ };
4622
+ /**
4623
+ * 403
4624
+ */
4625
+ 403: {
4626
+ message: string;
4627
+ };
4628
+ /**
4629
+ * 404
4630
+ */
4631
+ 404: {
4632
+ message: string;
4633
+ };
4634
+ /**
4635
+ * 429
4636
+ */
4637
+ 429: {
4638
+ message: string;
4639
+ };
4640
+ /**
4641
+ * 500
4642
+ */
4643
+ 500: {
4644
+ message: string;
4645
+ };
4646
+ };
4647
+ };
4335
4648
  post: {
4336
4649
  req: TeamCreateTeamData;
4337
4650
  res: {
@@ -4827,6 +5140,13 @@ type $OpenApiTs = {
4827
5140
  ext?: string | null;
4828
5141
  createdAt: string | null;
4829
5142
  updatedAt: string | null;
5143
+ posts: Array<{
5144
+ postId: string;
5145
+ uploadId: string;
5146
+ createdAt: string | null;
5147
+ updatedAt: string | null;
5148
+ deletedAt?: string | null;
5149
+ }>;
4830
5150
  }>;
4831
5151
  /**
4832
5152
  * 400
@@ -5036,6 +5356,13 @@ type $OpenApiTs = {
5036
5356
  ext?: string | null;
5037
5357
  createdAt: string | null;
5038
5358
  updatedAt: string | null;
5359
+ posts: Array<{
5360
+ postId: string;
5361
+ uploadId: string;
5362
+ createdAt: string | null;
5363
+ updatedAt: string | null;
5364
+ deletedAt?: string | null;
5365
+ }>;
5039
5366
  };
5040
5367
  /**
5041
5368
  * 400
@@ -5288,7 +5615,7 @@ type $OpenApiTs = {
5288
5615
  title: string;
5289
5616
  postDate: string | null;
5290
5617
  postedDate?: string | null;
5291
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
5618
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
5292
5619
  data: {
5293
5620
  TWITTER?: {
5294
5621
  text?: string | null;
@@ -5680,7 +6007,7 @@ type $OpenApiTs = {
5680
6007
  title: string;
5681
6008
  postDate: string | null;
5682
6009
  postedDate?: string | null;
5683
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
6010
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
5684
6011
  data: {
5685
6012
  TWITTER?: {
5686
6013
  text?: string | null;
@@ -6012,7 +6339,7 @@ type $OpenApiTs = {
6012
6339
  title: string;
6013
6340
  postDate: string | null;
6014
6341
  postedDate?: string | null;
6015
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
6342
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
6016
6343
  data: {
6017
6344
  TWITTER?: {
6018
6345
  text?: string | null;
@@ -6347,7 +6674,7 @@ type $OpenApiTs = {
6347
6674
  title: string;
6348
6675
  postDate: string | null;
6349
6676
  postedDate?: string | null;
6350
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
6677
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
6351
6678
  data: {
6352
6679
  TWITTER?: {
6353
6680
  text?: string | null;
@@ -6741,7 +7068,7 @@ type $OpenApiTs = {
6741
7068
  title: string;
6742
7069
  postDate: string | null;
6743
7070
  postedDate?: string | null;
6744
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
7071
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
6745
7072
  data: {
6746
7073
  TWITTER?: {
6747
7074
  text?: string | null;
@@ -7269,7 +7596,7 @@ type $OpenApiTs = {
7269
7596
  title: string;
7270
7597
  postDate: string | null;
7271
7598
  postedDate?: string | null;
7272
- status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING';
7599
+ status: 'DRAFT' | 'SCHEDULED' | 'POSTED' | 'ERROR' | 'DELETED' | 'PROCESSING' | 'REVIEW';
7273
7600
  data: {
7274
7601
  TWITTER?: {
7275
7602
  text?: string | null;
@@ -8440,6 +8767,15 @@ declare class TeamService {
8440
8767
  * @throws ApiError
8441
8768
  */
8442
8769
  teamDeleteTeam(data: TeamDeleteTeamData): CancelablePromise<TeamDeleteTeamResponse>;
8770
+ /**
8771
+ * Get list of teams
8772
+ * @param data The data for the request.
8773
+ * @param data.offset
8774
+ * @param data.limit
8775
+ * @returns unknown 200
8776
+ * @throws ApiError
8777
+ */
8778
+ teamGetList(data?: TeamGetListData): CancelablePromise<TeamGetListResponse>;
8443
8779
  /**
8444
8780
  * Create new team
8445
8781
  * @param data The data for the request.
@@ -8514,6 +8850,7 @@ declare class UploadService {
8514
8850
  * @param data The data for the request.
8515
8851
  * @param data.teamId
8516
8852
  * @param data.type
8853
+ * @param data.status
8517
8854
  * @returns unknown 200
8518
8855
  * @throws ApiError
8519
8856
  */
@@ -8778,4 +9115,4 @@ declare class Bundlesocial extends Client {
8778
9115
  constructor(apiKey: string, options?: OpenAPIConfig);
8779
9116
  }
8780
9117
 
8781
- export { $OpenApiTs, AnalyticsGetProfileAnalyticsData, AnalyticsGetProfileAnalyticsResponse, AnalyticsGetProfilePostData, AnalyticsGetProfilePostResponse, AnalyticsGetProfilePostsData, AnalyticsGetProfilePostsResponse, ApiError, AppGetHealthResponse, BaseHttpRequest, Bundlesocial, CancelError, CancelablePromise, CommentCreateData, CommentCreateResponse, CommentDeleteData, CommentDeleteResponse, CommentGetData, CommentGetListData, CommentGetListResponse, CommentGetResponse, CommentUpdateData, CommentUpdateResponse, OpenAPI, OpenAPIConfig, OrganizationGetOrganizationResponse, PostCreateData, PostCreateResponse, PostDeleteData, PostDeleteResponse, PostGetData, PostGetListData, PostGetListResponse, PostGetResponse, PostUpdateData, PostUpdateResponse, SocialAccountConnectData, SocialAccountConnectResponse, SocialAccountCopyData, SocialAccountCopyResponse, SocialAccountCreatePortalLinkData, SocialAccountCreatePortalLinkResponse, SocialAccountDisconnectData, SocialAccountDisconnectResponse, SocialAccountRefreshChannelsData, SocialAccountRefreshChannelsResponse, SocialAccountSetChannelData, SocialAccountSetChannelResponse, TeamCreateTeamData, TeamCreateTeamResponse, TeamDeleteTeamData, TeamDeleteTeamResponse, TeamGetTeamData, TeamGetTeamResponse, TeamUpdateTeamData, TeamUpdateTeamResponse, UploadCreateData, UploadCreateResponse, UploadDeleteData, UploadDeleteManyData, UploadDeleteManyResponse, UploadDeleteResponse, UploadFinalizeLargeUploadData, UploadFinalizeLargeUploadResponse, UploadGetData, UploadGetListData, UploadGetListResponse, UploadGetResponse, UploadInitLargeUploadData, UploadInitLargeUploadResponse, WebhookEvent, WebhookEventType, webhookEventTypes };
9118
+ export { $OpenApiTs, AnalyticsGetProfileAnalyticsData, AnalyticsGetProfileAnalyticsResponse, AnalyticsGetProfilePostData, AnalyticsGetProfilePostResponse, AnalyticsGetProfilePostsData, AnalyticsGetProfilePostsResponse, ApiError, AppGetHealthResponse, BaseHttpRequest, Bundlesocial, CancelError, CancelablePromise, CommentCreateData, CommentCreateResponse, CommentDeleteData, CommentDeleteResponse, CommentGetData, CommentGetListData, CommentGetListResponse, CommentGetResponse, CommentUpdateData, CommentUpdateResponse, OpenAPI, OpenAPIConfig, OrganizationGetOrganizationResponse, PostCreateData, PostCreateResponse, PostDeleteData, PostDeleteResponse, PostGetData, PostGetListData, PostGetListResponse, PostGetResponse, PostUpdateData, PostUpdateResponse, SocialAccountConnectData, SocialAccountConnectResponse, SocialAccountCopyData, SocialAccountCopyResponse, SocialAccountCreatePortalLinkData, SocialAccountCreatePortalLinkResponse, SocialAccountDisconnectData, SocialAccountDisconnectResponse, SocialAccountRefreshChannelsData, SocialAccountRefreshChannelsResponse, SocialAccountSetChannelData, SocialAccountSetChannelResponse, TeamCreateTeamData, TeamCreateTeamResponse, TeamDeleteTeamData, TeamDeleteTeamResponse, TeamGetListData, TeamGetListResponse, TeamGetTeamData, TeamGetTeamResponse, TeamUpdateTeamData, TeamUpdateTeamResponse, UploadCreateData, UploadCreateResponse, UploadDeleteData, UploadDeleteManyData, UploadDeleteManyResponse, UploadDeleteResponse, UploadFinalizeLargeUploadData, UploadFinalizeLargeUploadResponse, UploadGetData, UploadGetListData, UploadGetListResponse, UploadGetResponse, UploadInitLargeUploadData, UploadInitLargeUploadResponse, WebhookEvent, WebhookEventType, webhookEventTypes };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var K=Object.create;var T=Object.defineProperty,V=Object.defineProperties,J=Object.getOwnPropertyDescriptor,Q=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertyNames,B=Object.getOwnPropertySymbols,Y=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var N=(t,e,s)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,u=(t,e)=>{for(var s in e||(e={}))k.call(e,s)&&N(t,s,e[s]);if(B)for(var s of B(e))Z.call(e,s)&&N(t,s,e[s]);return t},b=(t,e)=>V(t,Q(e));var ee=(t,e)=>{for(var s in e)T(t,s,{get:e[s],enumerable:!0})},M=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of X(e))!k.call(t,r)&&r!==s&&T(t,r,{get:()=>e[r],enumerable:!(o=J(e,r))||o.enumerable});return t};var te=(t,e,s)=>(s=t!=null?K(Y(t)):{},M(e||!t||!t.__esModule?T(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>M(T({},"__esModule",{value:!0}),t);var h=(t,e,s)=>new Promise((o,r)=>{var a=p=>{try{n(s.next(p))}catch(l){r(l)}},i=p=>{try{n(s.throw(p))}catch(l){r(l)}},n=p=>p.done?o(p.value):Promise.resolve(p.value).then(a,i);n((s=s.apply(t,e)).next())});var Re={};ee(Re,{ApiError:()=>c,BaseHttpRequest:()=>m,Bundlesocial:()=>_,CancelError:()=>y,CancelablePromise:()=>R,OpenAPI:()=>P,webhookEventTypes:()=>me});module.exports=se(Re);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]}},P={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 c=class extends Error{constructor(s,o,r){super(r);this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=s}};var y=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},R=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((s,o)=>{this._resolve=s,this._reject=o;let r=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(n))},a=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(n))},i=n=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(n)};return Object.defineProperty(i,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(i,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(i,"isCancelled",{get:()=>this._isCancelled}),e(r,a,i)})}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 y("Request aborted"))}}get isCancelled(){return this._isCancelled}};var C=t=>typeof t=="string",w=t=>C(t)&&t!=="",H=t=>t instanceof Blob,z=t=>t instanceof FormData,oe=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},re=t=>{let e=[],s=(r,a)=>{e.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(a))}`)},o=(r,a)=>{a!=null&&(a instanceof Date?s(r,a.toISOString()):Array.isArray(a)?a.forEach(i=>o(r,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>o(`${r}[${i}]`,n)):s(r,a))};return Object.entries(t).forEach(([r,a])=>o(r,a)),e.length?`?${e.join("&")}`:""},ae=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,o=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(a,i)=>{var n;return(n=e.path)!=null&&n.hasOwnProperty(i)?s(String(e.path[i])):a}),r=t.BASE+o;return e.query?r+re(e.query):r},ne=t=>{if(t.formData){let e=new FormData,s=(o,r)=>{C(r)||H(r)?e.append(o,r):e.append(o,JSON.stringify(r))};return Object.entries(t.formData).filter(([,o])=>o!=null).forEach(([o,r])=>{Array.isArray(r)?r.forEach(a=>s(o,a)):s(o,r)}),e}},A=(t,e)=>h(void 0,null,function*(){return typeof e=="function"?e(t):e}),ie=(t,e)=>h(void 0,null,function*(){let[s,o,r,a]=yield Promise.all([A(e,t.TOKEN),A(e,t.USERNAME),A(e,t.PASSWORD),A(e,t.HEADERS)]),i=Object.entries(u(u({Accept:"application/json"},a),e.headers)).filter(([,n])=>n!=null).reduce((n,[p,l])=>b(u({},n),{[p]:String(l)}),{});if(w(s)&&(i.Authorization=`Bearer ${s}`),w(o)&&w(r)){let n=oe(`${o}:${r}`);i.Authorization=`Basic ${n}`}return e.body!==void 0&&(e.mediaType?i["Content-Type"]=e.mediaType:H(e.body)?i["Content-Type"]=e.body.type||"application/octet-stream":C(e.body)?i["Content-Type"]="text/plain":z(e.body)||(i["Content-Type"]="application/json")),new Headers(i)}),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):C(t.body)||H(t.body)||z(t.body)?t.body:JSON.stringify(t.body)},le=(t,e,s,o,r,a,i)=>h(void 0,null,function*(){let n=new AbortController,p={headers:a,body:o!=null?o:r,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return i(()=>n.abort()),yield fetch(s,p)}),ue=(t,e)=>{if(e){let s=t.headers.get(e);if(C(s))return s}},ce=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)}}),de=(t,e)=>{var r,a;let o=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(o)throw new c(t,e,o);if(!e.ok){let i=(r=e.status)!=null?r:"unknown",n=(a=e.statusText)!=null?a:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new c(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${p}`)}},F=(t,e)=>new R((s,o,r)=>h(void 0,null,function*(){try{let a=ae(t,e),i=ne(e),n=pe(e),p=yield ie(t,e);if(!r.isCancelled){let l=yield le(t,e,a,n,i,p,r);for(let $ of t.interceptors.response._fns)l=yield $(l);let q=yield ce(l),U=ue(l,e.responseHeader),j={url:a,ok:l.ok,status:l.status,statusText:l.statusText,body:U!=null?U:q};de(e,j),s(j.body)}}catch(a){o(a)}}));var D=class extends m{constructor(e){super(e)}request(e){return F(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"}})}},O=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"}})}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"}})}},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},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"}})}},g=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"}})}},I=class{constructor(e){this.httpRequest=e}analyticsGetProfileAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",query:{teamId:e.teamId,platformType:e.platformType},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"}})}},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"}})}};var f=class{constructor(e,s=D){var o,r,a,i,n,p,l,q;this.request=new s({BASE:(o=e==null?void 0:e.BASE)!=null?o:"https://api.bundle.social",VERSION:(r=e==null?void 0:e.VERSION)!=null?r:"1.0.0",WITH_CREDENTIALS:(a=e==null?void 0:e.WITH_CREDENTIALS)!=null?a:!1,CREDENTIALS:(i=e==null?void 0:e.CREDENTIALS)!=null?i:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?p:new d,response:(q=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?q:new d}}),this.analytics=new I(this.request),this.app=new E(this.request),this.comment=new x(this.request),this.organization=new S(this.request),this.post=new g(this.request),this.socialAccount=new v(this.request),this.team=new O(this.request),this.upload=new G(this.request)}};var W=te(require("crypto"));var me=["post.published","comment.published","team.created","team.updated","team.deleted","social-account.created","social-account.updated","social-account.deleted"],L=class{constructor(){}verifySignature(e,s,o){return W.default.createHmac("sha256",o).update(e).digest("hex")===s}constructEvent(e,s,o){let r=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(r,s,o))throw new Error("Invalid signature");return JSON.parse(r)}},_=class extends f{constructor(s,o){super(b(u({},o),{HEADERS:b(u(u({},P.HEADERS),o==null?void 0:o.HEADERS),{"x-api-key":s})}));this.webhooks=new L}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI,webhookEventTypes});
1
+ "use strict";var K=Object.create;var T=Object.defineProperty,V=Object.defineProperties,J=Object.getOwnPropertyDescriptor,Q=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertyNames,B=Object.getOwnPropertySymbols,Y=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var N=(t,e,s)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,u=(t,e)=>{for(var s in e||(e={}))k.call(e,s)&&N(t,s,e[s]);if(B)for(var s of B(e))Z.call(e,s)&&N(t,s,e[s]);return t},b=(t,e)=>V(t,Q(e));var ee=(t,e)=>{for(var s in e)T(t,s,{get:e[s],enumerable:!0})},M=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of X(e))!k.call(t,r)&&r!==s&&T(t,r,{get:()=>e[r],enumerable:!(o=J(e,r))||o.enumerable});return t};var te=(t,e,s)=>(s=t!=null?K(Y(t)):{},M(e||!t||!t.__esModule?T(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>M(T({},"__esModule",{value:!0}),t);var h=(t,e,s)=>new Promise((o,r)=>{var a=p=>{try{n(s.next(p))}catch(l){r(l)}},i=p=>{try{n(s.throw(p))}catch(l){r(l)}},n=p=>p.done?o(p.value):Promise.resolve(p.value).then(a,i);n((s=s.apply(t,e)).next())});var Re={};ee(Re,{ApiError:()=>c,BaseHttpRequest:()=>m,Bundlesocial:()=>_,CancelError:()=>y,CancelablePromise:()=>R,OpenAPI:()=>P,webhookEventTypes:()=>me});module.exports=se(Re);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]}},P={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 c=class extends Error{constructor(s,o,r){super(r);this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=s}};var y=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},R=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((s,o)=>{this._resolve=s,this._reject=o;let r=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(n))},a=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(n))},i=n=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(n)};return Object.defineProperty(i,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(i,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(i,"isCancelled",{get:()=>this._isCancelled}),e(r,a,i)})}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 y("Request aborted"))}}get isCancelled(){return this._isCancelled}};var C=t=>typeof t=="string",w=t=>C(t)&&t!=="",L=t=>t instanceof Blob,z=t=>t instanceof FormData,oe=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},re=t=>{let e=[],s=(r,a)=>{e.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(a))}`)},o=(r,a)=>{a!=null&&(a instanceof Date?s(r,a.toISOString()):Array.isArray(a)?a.forEach(i=>o(r,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>o(`${r}[${i}]`,n)):s(r,a))};return Object.entries(t).forEach(([r,a])=>o(r,a)),e.length?`?${e.join("&")}`:""},ae=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,o=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(a,i)=>{var n;return(n=e.path)!=null&&n.hasOwnProperty(i)?s(String(e.path[i])):a}),r=t.BASE+o;return e.query?r+re(e.query):r},ne=t=>{if(t.formData){let e=new FormData,s=(o,r)=>{C(r)||L(r)?e.append(o,r):e.append(o,JSON.stringify(r))};return Object.entries(t.formData).filter(([,o])=>o!=null).forEach(([o,r])=>{Array.isArray(r)?r.forEach(a=>s(o,a)):s(o,r)}),e}},A=(t,e)=>h(void 0,null,function*(){return typeof e=="function"?e(t):e}),ie=(t,e)=>h(void 0,null,function*(){let[s,o,r,a]=yield Promise.all([A(e,t.TOKEN),A(e,t.USERNAME),A(e,t.PASSWORD),A(e,t.HEADERS)]),i=Object.entries(u(u({Accept:"application/json"},a),e.headers)).filter(([,n])=>n!=null).reduce((n,[p,l])=>b(u({},n),{[p]:String(l)}),{});if(w(s)&&(i.Authorization=`Bearer ${s}`),w(o)&&w(r)){let n=oe(`${o}:${r}`);i.Authorization=`Basic ${n}`}return e.body!==void 0&&(e.mediaType?i["Content-Type"]=e.mediaType:L(e.body)?i["Content-Type"]=e.body.type||"application/octet-stream":C(e.body)?i["Content-Type"]="text/plain":z(e.body)||(i["Content-Type"]="application/json")),new Headers(i)}),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):C(t.body)||L(t.body)||z(t.body)?t.body:JSON.stringify(t.body)},le=(t,e,s,o,r,a,i)=>h(void 0,null,function*(){let n=new AbortController,p={headers:a,body:o!=null?o:r,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return i(()=>n.abort()),yield fetch(s,p)}),ue=(t,e)=>{if(e){let s=t.headers.get(e);if(C(s))return s}},ce=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)}}),de=(t,e)=>{var r,a;let o=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(o)throw new c(t,e,o);if(!e.ok){let i=(r=e.status)!=null?r:"unknown",n=(a=e.statusText)!=null?a:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new c(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${p}`)}},F=(t,e)=>new R((s,o,r)=>h(void 0,null,function*(){try{let a=ae(t,e),i=ne(e),n=pe(e),p=yield ie(t,e);if(!r.isCancelled){let l=yield le(t,e,a,n,i,p,r);for(let $ of t.interceptors.response._fns)l=yield $(l);let q=yield ce(l),U=ue(l,e.responseHeader),j={url:a,ok:l.ok,status:l.status,statusText:l.statusText,body:U!=null?U:q};de(e,j),s(j.body)}}catch(a){o(a)}}));var D=class extends m{constructor(e){super(e)}request(e){return F(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"}})}},O=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"}})}},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"}})}},g=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"}})}},I=class{constructor(e){this.httpRequest=e}analyticsGetProfileAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",query:{teamId:e.teamId,platformType:e.platformType},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"}})}},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"}})}};var f=class{constructor(e,s=D){var o,r,a,i,n,p,l,q;this.request=new s({BASE:(o=e==null?void 0:e.BASE)!=null?o:"https://api.bundle.social",VERSION:(r=e==null?void 0:e.VERSION)!=null?r:"1.0.0",WITH_CREDENTIALS:(a=e==null?void 0:e.WITH_CREDENTIALS)!=null?a:!1,CREDENTIALS:(i=e==null?void 0:e.CREDENTIALS)!=null?i:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?p:new d,response:(q=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?q:new d}}),this.analytics=new I(this.request),this.app=new E(this.request),this.comment=new x(this.request),this.organization=new S(this.request),this.post=new g(this.request),this.socialAccount=new v(this.request),this.team=new O(this.request),this.upload=new G(this.request)}};var W=te(require("crypto"));var me=["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 W.default.createHmac("sha256",o).update(e).digest("hex")===s}constructEvent(e,s,o){let r=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(r,s,o))throw new Error("Invalid signature");return JSON.parse(r)}},_=class extends f{constructor(s,o){super(b(u({},o),{HEADERS:b(u(u({},P.HEADERS),o==null?void 0:o.HEADERS),{"x-api-key":s})}));this.webhooks=new H}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI,webhookEventTypes});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var z=Object.defineProperty,F=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var j=(t,e,s)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,u=(t,e)=>{for(var s in e||(e={}))$.call(e,s)&&j(t,s,e[s]);if(_)for(var s of _(e))K.call(e,s)&&j(t,s,e[s]);return t},y=(t,e)=>F(t,W(e));var m=(t,e,s)=>new Promise((o,r)=>{var a=p=>{try{n(s.next(p))}catch(l){r(l)}},i=p=>{try{n(s.throw(p))}catch(l){r(l)}},n=p=>p.done?o(p.value):Promise.resolve(p.value).then(a,i);n((s=s.apply(t,e)).next())});var c=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]}},x={BASE:"https://api.bundle.social",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"1.0.0",WITH_CREDENTIALS:!1,interceptors:{request:new c,response:new c}};var R=class{constructor(e){this.config=e}};var d=class extends Error{constructor(s,o,r){super(r);this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=s}};var T=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 r=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(n))},a=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(n))},i=n=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(n)};return Object.defineProperty(i,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(i,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(i,"isCancelled",{get:()=>this._isCancelled}),e(r,a,i)})}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 T("Request aborted"))}}get isCancelled(){return this._isCancelled}};var b=t=>typeof t=="string",U=t=>b(t)&&t!=="",w=t=>t instanceof Blob,B=t=>t instanceof FormData,V=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},J=t=>{let e=[],s=(r,a)=>{e.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(a))}`)},o=(r,a)=>{a!=null&&(a instanceof Date?s(r,a.toISOString()):Array.isArray(a)?a.forEach(i=>o(r,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>o(`${r}[${i}]`,n)):s(r,a))};return Object.entries(t).forEach(([r,a])=>o(r,a)),e.length?`?${e.join("&")}`:""},Q=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,o=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(a,i)=>{var n;return(n=e.path)!=null&&n.hasOwnProperty(i)?s(String(e.path[i])):a}),r=t.BASE+o;return e.query?r+J(e.query):r},X=t=>{if(t.formData){let e=new FormData,s=(o,r)=>{b(r)||w(r)?e.append(o,r):e.append(o,JSON.stringify(r))};return Object.entries(t.formData).filter(([,o])=>o!=null).forEach(([o,r])=>{Array.isArray(r)?r.forEach(a=>s(o,a)):s(o,r)}),e}},q=(t,e)=>m(void 0,null,function*(){return typeof e=="function"?e(t):e}),Y=(t,e)=>m(void 0,null,function*(){let[s,o,r,a]=yield Promise.all([q(e,t.TOKEN),q(e,t.USERNAME),q(e,t.PASSWORD),q(e,t.HEADERS)]),i=Object.entries(u(u({Accept:"application/json"},a),e.headers)).filter(([,n])=>n!=null).reduce((n,[p,l])=>y(u({},n),{[p]:String(l)}),{});if(U(s)&&(i.Authorization=`Bearer ${s}`),U(o)&&U(r)){let n=V(`${o}:${r}`);i.Authorization=`Basic ${n}`}return e.body!==void 0&&(e.mediaType?i["Content-Type"]=e.mediaType:w(e.body)?i["Content-Type"]=e.body.type||"application/octet-stream":b(e.body)?i["Content-Type"]="text/plain":B(e.body)||(i["Content-Type"]="application/json")),new Headers(i)}),Z=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):b(t.body)||w(t.body)||B(t.body)?t.body:JSON.stringify(t.body)},ee=(t,e,s,o,r,a,i)=>m(void 0,null,function*(){let n=new AbortController,p={headers:a,body:o!=null?o:r,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return i(()=>n.abort()),yield fetch(s,p)}),te=(t,e)=>{if(e){let s=t.headers.get(e);if(b(s))return s}},se=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)}}),oe=(t,e)=>{var r,a;let o=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(o)throw new d(t,e,o);if(!e.ok){let i=(r=e.status)!=null?r:"unknown",n=(a=e.statusText)!=null?a:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new d(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${p}`)}},N=(t,e)=>new h((s,o,r)=>m(void 0,null,function*(){try{let a=Q(t,e),i=X(e),n=Z(e),p=yield Y(t,e);if(!r.isCancelled){let l=yield ee(t,e,a,n,i,p,r);for(let M of t.interceptors.response._fns)l=yield M(l);let f=yield se(l),I=te(l,e.responseHeader),L={url:a,ok:l.ok,status:l.status,statusText:l.statusText,body:I!=null?I:f};oe(e,L),s(L.body)}}catch(a){o(a)}}));var P=class extends R{constructor(e){super(e)}request(e){return N(this.config,e)}};var A=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"}})}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"}})}},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},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"}})}},G=class{constructor(e){this.httpRequest=e}analyticsGetProfileAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",query:{teamId:e.teamId,platformType:e.platformType},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"}})}},g=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"}})}};var C=class{constructor(e,s=P){var o,r,a,i,n,p,l,f;this.request=new s({BASE:(o=e==null?void 0:e.BASE)!=null?o:"https://api.bundle.social",VERSION:(r=e==null?void 0:e.VERSION)!=null?r:"1.0.0",WITH_CREDENTIALS:(a=e==null?void 0:e.WITH_CREDENTIALS)!=null?a:!1,CREDENTIALS:(i=e==null?void 0:e.CREDENTIALS)!=null?i:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?p:new c,response:(f=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?f:new c}}),this.analytics=new G(this.request),this.app=new A(this.request),this.comment=new g(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 O(this.request)}};import re from"crypto";var Me=["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 r=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(r,s,o))throw new Error("Invalid signature");return JSON.parse(r)}},k=class extends C{constructor(s,o){super(y(u({},o),{HEADERS:y(u(u({},x.HEADERS),o==null?void 0:o.HEADERS),{"x-api-key":s})}));this.webhooks=new H}};export{d as ApiError,R as BaseHttpRequest,k as Bundlesocial,T as CancelError,h as CancelablePromise,x as OpenAPI,Me as webhookEventTypes};
1
+ var z=Object.defineProperty,F=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var j=(t,e,s)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,u=(t,e)=>{for(var s in e||(e={}))$.call(e,s)&&j(t,s,e[s]);if(_)for(var s of _(e))K.call(e,s)&&j(t,s,e[s]);return t},y=(t,e)=>F(t,W(e));var m=(t,e,s)=>new Promise((o,r)=>{var a=p=>{try{n(s.next(p))}catch(l){r(l)}},i=p=>{try{n(s.throw(p))}catch(l){r(l)}},n=p=>p.done?o(p.value):Promise.resolve(p.value).then(a,i);n((s=s.apply(t,e)).next())});var c=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]}},x={BASE:"https://api.bundle.social",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"1.0.0",WITH_CREDENTIALS:!1,interceptors:{request:new c,response:new c}};var R=class{constructor(e){this.config=e}};var d=class extends Error{constructor(s,o,r){super(r);this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=s}};var T=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 r=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(n))},a=n=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(n))},i=n=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(n)};return Object.defineProperty(i,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(i,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(i,"isCancelled",{get:()=>this._isCancelled}),e(r,a,i)})}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 T("Request aborted"))}}get isCancelled(){return this._isCancelled}};var b=t=>typeof t=="string",U=t=>b(t)&&t!=="",w=t=>t instanceof Blob,B=t=>t instanceof FormData,V=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},J=t=>{let e=[],s=(r,a)=>{e.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(a))}`)},o=(r,a)=>{a!=null&&(a instanceof Date?s(r,a.toISOString()):Array.isArray(a)?a.forEach(i=>o(r,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>o(`${r}[${i}]`,n)):s(r,a))};return Object.entries(t).forEach(([r,a])=>o(r,a)),e.length?`?${e.join("&")}`:""},Q=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,o=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(a,i)=>{var n;return(n=e.path)!=null&&n.hasOwnProperty(i)?s(String(e.path[i])):a}),r=t.BASE+o;return e.query?r+J(e.query):r},X=t=>{if(t.formData){let e=new FormData,s=(o,r)=>{b(r)||w(r)?e.append(o,r):e.append(o,JSON.stringify(r))};return Object.entries(t.formData).filter(([,o])=>o!=null).forEach(([o,r])=>{Array.isArray(r)?r.forEach(a=>s(o,a)):s(o,r)}),e}},q=(t,e)=>m(void 0,null,function*(){return typeof e=="function"?e(t):e}),Y=(t,e)=>m(void 0,null,function*(){let[s,o,r,a]=yield Promise.all([q(e,t.TOKEN),q(e,t.USERNAME),q(e,t.PASSWORD),q(e,t.HEADERS)]),i=Object.entries(u(u({Accept:"application/json"},a),e.headers)).filter(([,n])=>n!=null).reduce((n,[p,l])=>y(u({},n),{[p]:String(l)}),{});if(U(s)&&(i.Authorization=`Bearer ${s}`),U(o)&&U(r)){let n=V(`${o}:${r}`);i.Authorization=`Basic ${n}`}return e.body!==void 0&&(e.mediaType?i["Content-Type"]=e.mediaType:w(e.body)?i["Content-Type"]=e.body.type||"application/octet-stream":b(e.body)?i["Content-Type"]="text/plain":B(e.body)||(i["Content-Type"]="application/json")),new Headers(i)}),Z=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):b(t.body)||w(t.body)||B(t.body)?t.body:JSON.stringify(t.body)},ee=(t,e,s,o,r,a,i)=>m(void 0,null,function*(){let n=new AbortController,p={headers:a,body:o!=null?o:r,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(p.credentials=t.CREDENTIALS);for(let l of t.interceptors.request._fns)p=yield l(p);return i(()=>n.abort()),yield fetch(s,p)}),te=(t,e)=>{if(e){let s=t.headers.get(e);if(b(s))return s}},se=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)}}),oe=(t,e)=>{var r,a;let o=u({400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},t.errors)[e.status];if(o)throw new d(t,e,o);if(!e.ok){let i=(r=e.status)!=null?r:"unknown",n=(a=e.statusText)!=null?a:"unknown",p=(()=>{try{return JSON.stringify(e.body,null,2)}catch(l){return}})();throw new d(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${p}`)}},N=(t,e)=>new h((s,o,r)=>m(void 0,null,function*(){try{let a=Q(t,e),i=X(e),n=Z(e),p=yield Y(t,e);if(!r.isCancelled){let l=yield ee(t,e,a,n,i,p,r);for(let M of t.interceptors.response._fns)l=yield M(l);let f=yield se(l),I=te(l,e.responseHeader),H={url:a,ok:l.ok,status:l.status,statusText:l.statusText,body:I!=null?I:f};oe(e,H),s(H.body)}}catch(a){o(a)}}));var P=class extends R{constructor(e){super(e)}request(e){return N(this.config,e)}};var A=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"}})}},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"}})}},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"}})}},G=class{constructor(e){this.httpRequest=e}analyticsGetProfileAnalytics(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile",query:{teamId:e.teamId,platformType:e.platformType},errors:{400:"400",401:"401",403:"403",404:"404",429:"429",500:"500"}})}analyticsGetProfilePosts(e){return this.httpRequest.request({method:"GET",url:"/api/v1/analytics/profile-post",query:{teamId:e.teamId,platformType:e.platformType},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"}})}},g=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"}})}};var C=class{constructor(e,s=P){var o,r,a,i,n,p,l,f;this.request=new s({BASE:(o=e==null?void 0:e.BASE)!=null?o:"https://api.bundle.social",VERSION:(r=e==null?void 0:e.VERSION)!=null?r:"1.0.0",WITH_CREDENTIALS:(a=e==null?void 0:e.WITH_CREDENTIALS)!=null?a:!1,CREDENTIALS:(i=e==null?void 0:e.CREDENTIALS)!=null?i:"include",TOKEN:e==null?void 0:e.TOKEN,USERNAME:e==null?void 0:e.USERNAME,PASSWORD:e==null?void 0:e.PASSWORD,HEADERS:e==null?void 0:e.HEADERS,ENCODE_PATH:e==null?void 0:e.ENCODE_PATH,interceptors:{request:(p=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?p:new c,response:(f=(l=e==null?void 0:e.interceptors)==null?void 0:l.response)!=null?f:new c}}),this.analytics=new G(this.request),this.app=new A(this.request),this.comment=new g(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 O(this.request)}};import re from"crypto";var Me=["post.published","comment.published","team.created","team.updated","team.deleted","social-account.created","social-account.updated","social-account.deleted"],L=class{constructor(){}verifySignature(e,s,o){return re.createHmac("sha256",o).update(e).digest("hex")===s}constructEvent(e,s,o){let r=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(r,s,o))throw new Error("Invalid signature");return JSON.parse(r)}},k=class extends C{constructor(s,o){super(y(u({},o),{HEADERS:y(u(u({},x.HEADERS),o==null?void 0:o.HEADERS),{"x-api-key":s})}));this.webhooks=new L}};export{d as ApiError,R as BaseHttpRequest,k as Bundlesocial,T as CancelError,h as CancelablePromise,x as OpenAPI,Me as webhookEventTypes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bundlesocial",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "Node.js library for the bundle.social API",
5
5
  "keywords": [
6
6
  "bundle.social",