bundlesocial 2.9.0 → 2.11.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 +127 -2
- package/dist/index.d.ts +127 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -148,6 +148,7 @@ type OrganizationGetOrganizationResponse = {
|
|
|
148
148
|
trialStart?: string | null;
|
|
149
149
|
trialEnd?: string | null;
|
|
150
150
|
maxMonthlyPosts: number;
|
|
151
|
+
maxMonthlyUploads: number;
|
|
151
152
|
discountStart?: string | null;
|
|
152
153
|
discountEnd?: string | null;
|
|
153
154
|
createdAt: string | null;
|
|
@@ -392,6 +393,7 @@ type TeamCreateTeamData = {
|
|
|
392
393
|
requestBody?: {
|
|
393
394
|
name: string;
|
|
394
395
|
avatarUrl?: string | null;
|
|
396
|
+
copyTeamId?: string | null;
|
|
395
397
|
};
|
|
396
398
|
};
|
|
397
399
|
type TeamCreateTeamResponse = {
|
|
@@ -498,7 +500,7 @@ type SocialAccountRefreshChannelsData = {
|
|
|
498
500
|
* Body
|
|
499
501
|
*/
|
|
500
502
|
requestBody?: {
|
|
501
|
-
type: 'DISCORD' | 'SLACK' | 'REDDIT' | 'PINTEREST';
|
|
503
|
+
type: 'DISCORD' | 'SLACK' | 'REDDIT' | 'PINTEREST' | 'FACEBOOK' | 'INSTAGRAM' | 'LINKEDIN' | 'YOUTUBE';
|
|
502
504
|
teamId: string;
|
|
503
505
|
};
|
|
504
506
|
};
|
|
@@ -543,6 +545,45 @@ type SocialAccountCreatePortalLinkData = {
|
|
|
543
545
|
type SocialAccountCreatePortalLinkResponse = {
|
|
544
546
|
url: string;
|
|
545
547
|
};
|
|
548
|
+
type SocialAccountCopyData = {
|
|
549
|
+
/**
|
|
550
|
+
* Body
|
|
551
|
+
*/
|
|
552
|
+
requestBody?: {
|
|
553
|
+
fromTeamId: string;
|
|
554
|
+
toTeamId: string;
|
|
555
|
+
/**
|
|
556
|
+
* If you set that to true, selected page will not be transferred automatically. The user will have to select the page themselves again. This only applies to Facebook, Instagram, Linkedin and Youtube.
|
|
557
|
+
*/
|
|
558
|
+
resetChannel?: boolean;
|
|
559
|
+
socialAccountTypes: Array<('TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK')>;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
type SocialAccountCopyResponse = Array<{
|
|
563
|
+
id: string;
|
|
564
|
+
type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
|
|
565
|
+
teamId: string;
|
|
566
|
+
username?: string | null;
|
|
567
|
+
displayName?: string | null;
|
|
568
|
+
externalId?: string | null;
|
|
569
|
+
userUsername?: string | null;
|
|
570
|
+
userDisplayName?: string | null;
|
|
571
|
+
userId?: string | null;
|
|
572
|
+
channels?: Array<{
|
|
573
|
+
id: string;
|
|
574
|
+
name?: string | null;
|
|
575
|
+
username?: string | null;
|
|
576
|
+
webhook?: {
|
|
577
|
+
id?: string | null;
|
|
578
|
+
name?: string | null;
|
|
579
|
+
avatar?: string | null;
|
|
580
|
+
url?: string | null;
|
|
581
|
+
} | null;
|
|
582
|
+
}> | null;
|
|
583
|
+
createdAt: string | null;
|
|
584
|
+
updatedAt: string | null;
|
|
585
|
+
deletedAt?: string | null;
|
|
586
|
+
}>;
|
|
546
587
|
type UploadGetListData = {
|
|
547
588
|
teamId?: string | null;
|
|
548
589
|
};
|
|
@@ -3762,6 +3803,7 @@ type $OpenApiTs = {
|
|
|
3762
3803
|
trialStart?: string | null;
|
|
3763
3804
|
trialEnd?: string | null;
|
|
3764
3805
|
maxMonthlyPosts: number;
|
|
3806
|
+
maxMonthlyUploads: number;
|
|
3765
3807
|
discountStart?: string | null;
|
|
3766
3808
|
discountEnd?: string | null;
|
|
3767
3809
|
createdAt: string | null;
|
|
@@ -4566,6 +4608,81 @@ type $OpenApiTs = {
|
|
|
4566
4608
|
};
|
|
4567
4609
|
};
|
|
4568
4610
|
};
|
|
4611
|
+
'/api/v1/social-account/copy': {
|
|
4612
|
+
post: {
|
|
4613
|
+
req: SocialAccountCopyData;
|
|
4614
|
+
res: {
|
|
4615
|
+
/**
|
|
4616
|
+
* 200
|
|
4617
|
+
*/
|
|
4618
|
+
200: Array<{
|
|
4619
|
+
id: string;
|
|
4620
|
+
type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
|
|
4621
|
+
teamId: string;
|
|
4622
|
+
username?: string | null;
|
|
4623
|
+
displayName?: string | null;
|
|
4624
|
+
externalId?: string | null;
|
|
4625
|
+
userUsername?: string | null;
|
|
4626
|
+
userDisplayName?: string | null;
|
|
4627
|
+
userId?: string | null;
|
|
4628
|
+
channels?: Array<{
|
|
4629
|
+
id: string;
|
|
4630
|
+
name?: string | null;
|
|
4631
|
+
username?: string | null;
|
|
4632
|
+
webhook?: {
|
|
4633
|
+
id?: string | null;
|
|
4634
|
+
name?: string | null;
|
|
4635
|
+
avatar?: string | null;
|
|
4636
|
+
url?: string | null;
|
|
4637
|
+
} | null;
|
|
4638
|
+
}> | null;
|
|
4639
|
+
createdAt: string | null;
|
|
4640
|
+
updatedAt: string | null;
|
|
4641
|
+
deletedAt?: string | null;
|
|
4642
|
+
}>;
|
|
4643
|
+
/**
|
|
4644
|
+
* 400
|
|
4645
|
+
*/
|
|
4646
|
+
400: {
|
|
4647
|
+
message: string;
|
|
4648
|
+
issues?: Array<{
|
|
4649
|
+
message: string;
|
|
4650
|
+
path?: Array<(string | number)> | null;
|
|
4651
|
+
}> | null;
|
|
4652
|
+
};
|
|
4653
|
+
/**
|
|
4654
|
+
* 401
|
|
4655
|
+
*/
|
|
4656
|
+
401: {
|
|
4657
|
+
message: string;
|
|
4658
|
+
};
|
|
4659
|
+
/**
|
|
4660
|
+
* 403
|
|
4661
|
+
*/
|
|
4662
|
+
403: {
|
|
4663
|
+
message: string;
|
|
4664
|
+
};
|
|
4665
|
+
/**
|
|
4666
|
+
* 404
|
|
4667
|
+
*/
|
|
4668
|
+
404: {
|
|
4669
|
+
message: string;
|
|
4670
|
+
};
|
|
4671
|
+
/**
|
|
4672
|
+
* 429
|
|
4673
|
+
*/
|
|
4674
|
+
429: {
|
|
4675
|
+
message: string;
|
|
4676
|
+
};
|
|
4677
|
+
/**
|
|
4678
|
+
* 500
|
|
4679
|
+
*/
|
|
4680
|
+
500: {
|
|
4681
|
+
message: string;
|
|
4682
|
+
};
|
|
4683
|
+
};
|
|
4684
|
+
};
|
|
4685
|
+
};
|
|
4569
4686
|
'/api/v1/upload/': {
|
|
4570
4687
|
get: {
|
|
4571
4688
|
req: UploadGetListData;
|
|
@@ -8175,6 +8292,14 @@ declare class SocialAccountService {
|
|
|
8175
8292
|
* @throws ApiError
|
|
8176
8293
|
*/
|
|
8177
8294
|
socialAccountCreatePortalLink(data?: SocialAccountCreatePortalLinkData): CancelablePromise<SocialAccountCreatePortalLinkResponse>;
|
|
8295
|
+
/**
|
|
8296
|
+
* Copy social accounts
|
|
8297
|
+
* @param data The data for the request.
|
|
8298
|
+
* @param data.requestBody Body
|
|
8299
|
+
* @returns unknown 200
|
|
8300
|
+
* @throws ApiError
|
|
8301
|
+
*/
|
|
8302
|
+
socialAccountCopy(data?: SocialAccountCopyData): CancelablePromise<SocialAccountCopyResponse>;
|
|
8178
8303
|
}
|
|
8179
8304
|
declare class UploadService {
|
|
8180
8305
|
readonly httpRequest: BaseHttpRequest;
|
|
@@ -8434,4 +8559,4 @@ declare class Bundlesocial extends Client {
|
|
|
8434
8559
|
constructor(apiKey: string, options?: OpenAPIConfig);
|
|
8435
8560
|
}
|
|
8436
8561
|
|
|
8437
|
-
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, 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 };
|
|
8562
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -148,6 +148,7 @@ type OrganizationGetOrganizationResponse = {
|
|
|
148
148
|
trialStart?: string | null;
|
|
149
149
|
trialEnd?: string | null;
|
|
150
150
|
maxMonthlyPosts: number;
|
|
151
|
+
maxMonthlyUploads: number;
|
|
151
152
|
discountStart?: string | null;
|
|
152
153
|
discountEnd?: string | null;
|
|
153
154
|
createdAt: string | null;
|
|
@@ -392,6 +393,7 @@ type TeamCreateTeamData = {
|
|
|
392
393
|
requestBody?: {
|
|
393
394
|
name: string;
|
|
394
395
|
avatarUrl?: string | null;
|
|
396
|
+
copyTeamId?: string | null;
|
|
395
397
|
};
|
|
396
398
|
};
|
|
397
399
|
type TeamCreateTeamResponse = {
|
|
@@ -498,7 +500,7 @@ type SocialAccountRefreshChannelsData = {
|
|
|
498
500
|
* Body
|
|
499
501
|
*/
|
|
500
502
|
requestBody?: {
|
|
501
|
-
type: 'DISCORD' | 'SLACK' | 'REDDIT' | 'PINTEREST';
|
|
503
|
+
type: 'DISCORD' | 'SLACK' | 'REDDIT' | 'PINTEREST' | 'FACEBOOK' | 'INSTAGRAM' | 'LINKEDIN' | 'YOUTUBE';
|
|
502
504
|
teamId: string;
|
|
503
505
|
};
|
|
504
506
|
};
|
|
@@ -543,6 +545,45 @@ type SocialAccountCreatePortalLinkData = {
|
|
|
543
545
|
type SocialAccountCreatePortalLinkResponse = {
|
|
544
546
|
url: string;
|
|
545
547
|
};
|
|
548
|
+
type SocialAccountCopyData = {
|
|
549
|
+
/**
|
|
550
|
+
* Body
|
|
551
|
+
*/
|
|
552
|
+
requestBody?: {
|
|
553
|
+
fromTeamId: string;
|
|
554
|
+
toTeamId: string;
|
|
555
|
+
/**
|
|
556
|
+
* If you set that to true, selected page will not be transferred automatically. The user will have to select the page themselves again. This only applies to Facebook, Instagram, Linkedin and Youtube.
|
|
557
|
+
*/
|
|
558
|
+
resetChannel?: boolean;
|
|
559
|
+
socialAccountTypes: Array<('TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK')>;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
type SocialAccountCopyResponse = Array<{
|
|
563
|
+
id: string;
|
|
564
|
+
type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
|
|
565
|
+
teamId: string;
|
|
566
|
+
username?: string | null;
|
|
567
|
+
displayName?: string | null;
|
|
568
|
+
externalId?: string | null;
|
|
569
|
+
userUsername?: string | null;
|
|
570
|
+
userDisplayName?: string | null;
|
|
571
|
+
userId?: string | null;
|
|
572
|
+
channels?: Array<{
|
|
573
|
+
id: string;
|
|
574
|
+
name?: string | null;
|
|
575
|
+
username?: string | null;
|
|
576
|
+
webhook?: {
|
|
577
|
+
id?: string | null;
|
|
578
|
+
name?: string | null;
|
|
579
|
+
avatar?: string | null;
|
|
580
|
+
url?: string | null;
|
|
581
|
+
} | null;
|
|
582
|
+
}> | null;
|
|
583
|
+
createdAt: string | null;
|
|
584
|
+
updatedAt: string | null;
|
|
585
|
+
deletedAt?: string | null;
|
|
586
|
+
}>;
|
|
546
587
|
type UploadGetListData = {
|
|
547
588
|
teamId?: string | null;
|
|
548
589
|
};
|
|
@@ -3762,6 +3803,7 @@ type $OpenApiTs = {
|
|
|
3762
3803
|
trialStart?: string | null;
|
|
3763
3804
|
trialEnd?: string | null;
|
|
3764
3805
|
maxMonthlyPosts: number;
|
|
3806
|
+
maxMonthlyUploads: number;
|
|
3765
3807
|
discountStart?: string | null;
|
|
3766
3808
|
discountEnd?: string | null;
|
|
3767
3809
|
createdAt: string | null;
|
|
@@ -4566,6 +4608,81 @@ type $OpenApiTs = {
|
|
|
4566
4608
|
};
|
|
4567
4609
|
};
|
|
4568
4610
|
};
|
|
4611
|
+
'/api/v1/social-account/copy': {
|
|
4612
|
+
post: {
|
|
4613
|
+
req: SocialAccountCopyData;
|
|
4614
|
+
res: {
|
|
4615
|
+
/**
|
|
4616
|
+
* 200
|
|
4617
|
+
*/
|
|
4618
|
+
200: Array<{
|
|
4619
|
+
id: string;
|
|
4620
|
+
type: 'TIKTOK' | 'YOUTUBE' | 'INSTAGRAM' | 'FACEBOOK' | 'TWITTER' | 'THREADS' | 'LINKEDIN' | 'PINTEREST' | 'REDDIT' | 'MASTODON' | 'DISCORD' | 'SLACK';
|
|
4621
|
+
teamId: string;
|
|
4622
|
+
username?: string | null;
|
|
4623
|
+
displayName?: string | null;
|
|
4624
|
+
externalId?: string | null;
|
|
4625
|
+
userUsername?: string | null;
|
|
4626
|
+
userDisplayName?: string | null;
|
|
4627
|
+
userId?: string | null;
|
|
4628
|
+
channels?: Array<{
|
|
4629
|
+
id: string;
|
|
4630
|
+
name?: string | null;
|
|
4631
|
+
username?: string | null;
|
|
4632
|
+
webhook?: {
|
|
4633
|
+
id?: string | null;
|
|
4634
|
+
name?: string | null;
|
|
4635
|
+
avatar?: string | null;
|
|
4636
|
+
url?: string | null;
|
|
4637
|
+
} | null;
|
|
4638
|
+
}> | null;
|
|
4639
|
+
createdAt: string | null;
|
|
4640
|
+
updatedAt: string | null;
|
|
4641
|
+
deletedAt?: string | null;
|
|
4642
|
+
}>;
|
|
4643
|
+
/**
|
|
4644
|
+
* 400
|
|
4645
|
+
*/
|
|
4646
|
+
400: {
|
|
4647
|
+
message: string;
|
|
4648
|
+
issues?: Array<{
|
|
4649
|
+
message: string;
|
|
4650
|
+
path?: Array<(string | number)> | null;
|
|
4651
|
+
}> | null;
|
|
4652
|
+
};
|
|
4653
|
+
/**
|
|
4654
|
+
* 401
|
|
4655
|
+
*/
|
|
4656
|
+
401: {
|
|
4657
|
+
message: string;
|
|
4658
|
+
};
|
|
4659
|
+
/**
|
|
4660
|
+
* 403
|
|
4661
|
+
*/
|
|
4662
|
+
403: {
|
|
4663
|
+
message: string;
|
|
4664
|
+
};
|
|
4665
|
+
/**
|
|
4666
|
+
* 404
|
|
4667
|
+
*/
|
|
4668
|
+
404: {
|
|
4669
|
+
message: string;
|
|
4670
|
+
};
|
|
4671
|
+
/**
|
|
4672
|
+
* 429
|
|
4673
|
+
*/
|
|
4674
|
+
429: {
|
|
4675
|
+
message: string;
|
|
4676
|
+
};
|
|
4677
|
+
/**
|
|
4678
|
+
* 500
|
|
4679
|
+
*/
|
|
4680
|
+
500: {
|
|
4681
|
+
message: string;
|
|
4682
|
+
};
|
|
4683
|
+
};
|
|
4684
|
+
};
|
|
4685
|
+
};
|
|
4569
4686
|
'/api/v1/upload/': {
|
|
4570
4687
|
get: {
|
|
4571
4688
|
req: UploadGetListData;
|
|
@@ -8175,6 +8292,14 @@ declare class SocialAccountService {
|
|
|
8175
8292
|
* @throws ApiError
|
|
8176
8293
|
*/
|
|
8177
8294
|
socialAccountCreatePortalLink(data?: SocialAccountCreatePortalLinkData): CancelablePromise<SocialAccountCreatePortalLinkResponse>;
|
|
8295
|
+
/**
|
|
8296
|
+
* Copy social accounts
|
|
8297
|
+
* @param data The data for the request.
|
|
8298
|
+
* @param data.requestBody Body
|
|
8299
|
+
* @returns unknown 200
|
|
8300
|
+
* @throws ApiError
|
|
8301
|
+
*/
|
|
8302
|
+
socialAccountCopy(data?: SocialAccountCopyData): CancelablePromise<SocialAccountCopyResponse>;
|
|
8178
8303
|
}
|
|
8179
8304
|
declare class UploadService {
|
|
8180
8305
|
readonly httpRequest: BaseHttpRequest;
|
|
@@ -8434,4 +8559,4 @@ declare class Bundlesocial extends Client {
|
|
|
8434
8559
|
constructor(apiKey: string, options?: OpenAPIConfig);
|
|
8435
8560
|
}
|
|
8436
8561
|
|
|
8437
|
-
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, 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 };
|
|
8562
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var V=Object.create;var b=Object.defineProperty,J=Object.defineProperties,K=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?b(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},T=(t,e)=>J(t,Q(e));var ee=(t,e)=>{for(var s in e)b(t,s,{get:e[s],enumerable:!0})},z=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X(e))!k.call(t,o)&&o!==s&&b(t,o,{get:()=>e[o],enumerable:!(r=K(e,o))||r.enumerable});return t};var te=(t,e,s)=>(s=t!=null?V(Y(t)):{},z(e||!t||!t.__esModule?b(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>z(b({},"__esModule",{value:!0}),t);var h=(t,e,s)=>new Promise((r,o)=>{var a=l=>{try{n(s.next(l))}catch(p){o(p)}},i=l=>{try{n(s.throw(l))}catch(p){o(p)}},n=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,i);n((s=s.apply(t,e)).next())});var me={};ee(me,{ApiError:()=>c,BaseHttpRequest:()=>m,Bundlesocial:()=>_,CancelError:()=>y,CancelablePromise:()=>R,OpenAPI:()=>P});module.exports=se(me);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,r,o){super(o);this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.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,r)=>{this._resolve=s,this._reject=r;let o=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(o,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 f=t=>typeof t=="string",w=t=>f(t)&&t!=="",H=t=>t instanceof Blob,F=t=>t instanceof FormData,re=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},oe=t=>{let e=[],s=(o,a)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(a))}`)},r=(o,a)=>{a!=null&&(a instanceof Date?s(o,a.toISOString()):Array.isArray(a)?a.forEach(i=>r(o,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>r(`${o}[${i}]`,n)):s(o,a))};return Object.entries(t).forEach(([o,a])=>r(o,a)),e.length?`?${e.join("&")}`:""},ae=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,r=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}),o=t.BASE+r;return e.query?o+oe(e.query):o},ne=t=>{if(t.formData){let e=new FormData,s=(r,o)=>{f(o)||H(o)?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t.formData).filter(([,r])=>r!=null).forEach(([r,o])=>{Array.isArray(o)?o.forEach(a=>s(r,a)):s(r,o)}),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,r,o,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,[l,p])=>T(u({},n),{[l]:String(p)}),{});if(w(s)&&(i.Authorization=`Bearer ${s}`),w(r)&&w(o)){let n=re(`${r}:${o}`);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":f(e.body)?i["Content-Type"]="text/plain":F(e.body)||(i["Content-Type"]="application/json")),new Headers(i)}),le=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):f(t.body)||H(t.body)||F(t.body)?t.body:JSON.stringify(t.body)},pe=(t,e,s,r,o,a,i)=>h(void 0,null,function*(){let n=new AbortController,l={headers:a,body:r!=null?r:o,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return i(()=>n.abort()),yield fetch(s,l)}),ue=(t,e)=>{if(e){let s=t.headers.get(e);if(f(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(r=>e.includes(r)))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 o,a;let r=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(r)throw new c(t,e,r);if(!e.ok){let i=(o=e.status)!=null?o:"unknown",n=(a=e.statusText)!=null?a:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new c(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${l}`)}},M=(t,e)=>new R((s,r,o)=>h(void 0,null,function*(){try{let a=ae(t,e),i=ne(e),n=le(e),l=yield ie(t,e);if(!o.isCancelled){let p=yield pe(t,e,a,n,i,l,o);for(let $ of t.interceptors.response._fns)p=yield $(p);let q=yield ce(p),U=ue(p,e.responseHeader),j={url:a,ok:p.ok,status:p.status,statusText:p.statusText,body:U!=null?U:q};de(e,j),s(j.body)}}catch(a){r(a)}}));var D=class extends m{constructor(e){super(e)}request(e){return M(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"}})}},g=class{constructor(e){this.httpRequest=e}uploadGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",query:{teamId:e.teamId},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 C=class{constructor(e,s=D){var r,o,a,i,n,l,p,q;this.request=new s({BASE:(r=e==null?void 0:e.BASE)!=null?r:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"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:(l=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?l:new d,response:(q=(p=e==null?void 0:e.interceptors)==null?void 0:p.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 L=class{constructor(){}verifySignature(e,s,r){return W.default.createHmac("sha256",r).update(e).digest("hex")===s}constructEvent(e,s,r){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,s,r))throw new Error("Invalid signature");return JSON.parse(o)}},_=class extends C{constructor(s,r){super(T(u({},r),{HEADERS:T(u(u({},P.HEADERS),r==null?void 0:r.HEADERS),{"x-api-key":s})}));this.webhooks=new L}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI});
|
|
1
|
+
"use strict";var V=Object.create;var b=Object.defineProperty,J=Object.defineProperties,K=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?b(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},T=(t,e)=>J(t,Q(e));var ee=(t,e)=>{for(var s in e)b(t,s,{get:e[s],enumerable:!0})},z=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X(e))!k.call(t,o)&&o!==s&&b(t,o,{get:()=>e[o],enumerable:!(r=K(e,o))||r.enumerable});return t};var te=(t,e,s)=>(s=t!=null?V(Y(t)):{},z(e||!t||!t.__esModule?b(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>z(b({},"__esModule",{value:!0}),t);var h=(t,e,s)=>new Promise((r,o)=>{var a=l=>{try{n(s.next(l))}catch(p){o(p)}},i=l=>{try{n(s.throw(l))}catch(p){o(p)}},n=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,i);n((s=s.apply(t,e)).next())});var me={};ee(me,{ApiError:()=>c,BaseHttpRequest:()=>m,Bundlesocial:()=>_,CancelError:()=>y,CancelablePromise:()=>R,OpenAPI:()=>f});module.exports=se(me);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]}},f={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,r,o){super(o);this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.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,r)=>{this._resolve=s,this._reject=r;let o=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(o,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,F=t=>t instanceof FormData,re=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},oe=t=>{let e=[],s=(o,a)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(a))}`)},r=(o,a)=>{a!=null&&(a instanceof Date?s(o,a.toISOString()):Array.isArray(a)?a.forEach(i=>r(o,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>r(`${o}[${i}]`,n)):s(o,a))};return Object.entries(t).forEach(([o,a])=>r(o,a)),e.length?`?${e.join("&")}`:""},ae=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,r=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}),o=t.BASE+r;return e.query?o+oe(e.query):o},ne=t=>{if(t.formData){let e=new FormData,s=(r,o)=>{C(o)||H(o)?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t.formData).filter(([,r])=>r!=null).forEach(([r,o])=>{Array.isArray(o)?o.forEach(a=>s(r,a)):s(r,o)}),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,r,o,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,[l,p])=>T(u({},n),{[l]:String(p)}),{});if(w(s)&&(i.Authorization=`Bearer ${s}`),w(r)&&w(o)){let n=re(`${r}:${o}`);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":F(e.body)||(i["Content-Type"]="application/json")),new Headers(i)}),le=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)||F(t.body)?t.body:JSON.stringify(t.body)},pe=(t,e,s,r,o,a,i)=>h(void 0,null,function*(){let n=new AbortController,l={headers:a,body:r!=null?r:o,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return i(()=>n.abort()),yield fetch(s,l)}),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(r=>e.includes(r)))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 o,a;let r=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(r)throw new c(t,e,r);if(!e.ok){let i=(o=e.status)!=null?o:"unknown",n=(a=e.statusText)!=null?a:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new c(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${l}`)}},M=(t,e)=>new R((s,r,o)=>h(void 0,null,function*(){try{let a=ae(t,e),i=ne(e),n=le(e),l=yield ie(t,e);if(!o.isCancelled){let p=yield pe(t,e,a,n,i,l,o);for(let $ of t.interceptors.response._fns)p=yield $(p);let P=yield ce(p),U=ue(p,e.responseHeader),j={url:a,ok:p.ok,status:p.status,statusText:p.statusText,body:U!=null?U:P};de(e,j),s(j.body)}}catch(a){r(a)}}));var D=class extends m{constructor(e){super(e)}request(e){return M(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},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 q=class{constructor(e,s=D){var r,o,a,i,n,l,p,P;this.request=new s({BASE:(r=e==null?void 0:e.BASE)!=null?r:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"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:(l=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?l:new d,response:(P=(p=e==null?void 0:e.interceptors)==null?void 0:p.response)!=null?P: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 L=class{constructor(){}verifySignature(e,s,r){return W.default.createHmac("sha256",r).update(e).digest("hex")===s}constructEvent(e,s,r){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,s,r))throw new Error("Invalid signature");return JSON.parse(o)}},_=class extends q{constructor(s,r){super(T(u({},r),{HEADERS:T(u(u({},f.HEADERS),r==null?void 0:r.HEADERS),{"x-api-key":s})}));this.webhooks=new L}};0&&(module.exports={ApiError,BaseHttpRequest,Bundlesocial,CancelError,CancelablePromise,OpenAPI});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var F=Object.defineProperty,M=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var j=(t,e,s)=>e in t?F(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))V.call(e,s)&&j(t,s,e[s]);return t},y=(t,e)=>M(t,W(e));var m=(t,e,s)=>new Promise((r,o)=>{var a=l=>{try{n(s.next(l))}catch(p){o(p)}},i=l=>{try{n(s.throw(l))}catch(p){o(p)}},n=l=>l.done?r(l.value):Promise.resolve(l.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,r,o){super(o);this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.body,this.request=s}};var b=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},h=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((s,r)=>{this._resolve=s,this._reject=r;let o=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(o,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 b("Request aborted"))}}get isCancelled(){return this._isCancelled}};var T=t=>typeof t=="string",U=t=>T(t)&&t!=="",w=t=>t instanceof Blob,B=t=>t instanceof FormData,J=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},K=t=>{let e=[],s=(o,a)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(a))}`)},r=(o,a)=>{a!=null&&(a instanceof Date?s(o,a.toISOString()):Array.isArray(a)?a.forEach(i=>r(o,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>r(`${o}[${i}]`,n)):s(o,a))};return Object.entries(t).forEach(([o,a])=>r(o,a)),e.length?`?${e.join("&")}`:""},Q=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,r=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}),o=t.BASE+r;return e.query?o+K(e.query):o},X=t=>{if(t.formData){let e=new FormData,s=(r,o)=>{T(o)||w(o)?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t.formData).filter(([,r])=>r!=null).forEach(([r,o])=>{Array.isArray(o)?o.forEach(a=>s(r,a)):s(r,o)}),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,r,o,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,[l,p])=>y(u({},n),{[l]:String(p)}),{});if(U(s)&&(i.Authorization=`Bearer ${s}`),U(r)&&U(o)){let n=J(`${r}:${o}`);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":T(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):T(t.body)||w(t.body)||B(t.body)?t.body:JSON.stringify(t.body)},ee=(t,e,s,r,o,a,i)=>m(void 0,null,function*(){let n=new AbortController,l={headers:a,body:r!=null?r:o,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return i(()=>n.abort()),yield fetch(s,l)}),te=(t,e)=>{if(e){let s=t.headers.get(e);if(T(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(r=>e.includes(r)))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)}}),re=(t,e)=>{var o,a;let r=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(r)throw new d(t,e,r);if(!e.ok){let i=(o=e.status)!=null?o:"unknown",n=(a=e.statusText)!=null?a:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new d(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${l}`)}},N=(t,e)=>new h((s,r,o)=>m(void 0,null,function*(){try{let a=Q(t,e),i=X(e),n=Z(e),l=yield Y(t,e);if(!o.isCancelled){let p=yield ee(t,e,a,n,i,l,o);for(let z of t.interceptors.response._fns)p=yield z(p);let C=yield se(p),I=te(p,e.responseHeader),L={url:a,ok:p.ok,status:p.status,statusText:p.statusText,body:I!=null?I:C};re(e,L),s(L.body)}}catch(a){r(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"}})}},O=class{constructor(e){this.httpRequest=e}uploadGetList(e={}){return this.httpRequest.request({method:"GET",url:"/api/v1/upload/",query:{teamId:e.teamId},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 f=class{constructor(e,s=P){var r,o,a,i,n,l,p,C;this.request=new s({BASE:(r=e==null?void 0:e.BASE)!=null?r:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"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:(l=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?l:new c,response:(C=(p=e==null?void 0:e.interceptors)==null?void 0:p.response)!=null?C: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 oe from"crypto";var H=class{constructor(){}verifySignature(e,s,r){return oe.createHmac("sha256",r).update(e).digest("hex")===s}constructEvent(e,s,r){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,s,r))throw new Error("Invalid signature");return JSON.parse(o)}},k=class extends f{constructor(s,r){super(y(u({},r),{HEADERS:y(u(u({},x.HEADERS),r==null?void 0:r.HEADERS),{"x-api-key":s})}));this.webhooks=new H}};export{d as ApiError,R as BaseHttpRequest,k as Bundlesocial,b as CancelError,h as CancelablePromise,x as OpenAPI};
|
|
1
|
+
var F=Object.defineProperty,M=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var j=(t,e,s)=>e in t?F(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))V.call(e,s)&&j(t,s,e[s]);return t},y=(t,e)=>M(t,W(e));var m=(t,e,s)=>new Promise((r,o)=>{var a=l=>{try{n(s.next(l))}catch(p){o(p)}},i=l=>{try{n(s.throw(l))}catch(p){o(p)}},n=l=>l.done?r(l.value):Promise.resolve(l.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,r,o){super(o);this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.body,this.request=s}};var b=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},h=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((s,r)=>{this._resolve=s,this._reject=r;let o=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(o,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 b("Request aborted"))}}get isCancelled(){return this._isCancelled}};var T=t=>typeof t=="string",U=t=>T(t)&&t!=="",w=t=>t instanceof Blob,B=t=>t instanceof FormData,J=t=>{try{return btoa(t)}catch(e){return Buffer.from(t).toString("base64")}},K=t=>{let e=[],s=(o,a)=>{e.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(a))}`)},r=(o,a)=>{a!=null&&(a instanceof Date?s(o,a.toISOString()):Array.isArray(a)?a.forEach(i=>r(o,i)):typeof a=="object"?Object.entries(a).forEach(([i,n])=>r(`${o}[${i}]`,n)):s(o,a))};return Object.entries(t).forEach(([o,a])=>r(o,a)),e.length?`?${e.join("&")}`:""},Q=(t,e)=>{let s=t.ENCODE_PATH||encodeURI,r=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}),o=t.BASE+r;return e.query?o+K(e.query):o},X=t=>{if(t.formData){let e=new FormData,s=(r,o)=>{T(o)||w(o)?e.append(r,o):e.append(r,JSON.stringify(o))};return Object.entries(t.formData).filter(([,r])=>r!=null).forEach(([r,o])=>{Array.isArray(o)?o.forEach(a=>s(r,a)):s(r,o)}),e}},P=(t,e)=>m(void 0,null,function*(){return typeof e=="function"?e(t):e}),Y=(t,e)=>m(void 0,null,function*(){let[s,r,o,a]=yield Promise.all([P(e,t.TOKEN),P(e,t.USERNAME),P(e,t.PASSWORD),P(e,t.HEADERS)]),i=Object.entries(u(u({Accept:"application/json"},a),e.headers)).filter(([,n])=>n!=null).reduce((n,[l,p])=>y(u({},n),{[l]:String(p)}),{});if(U(s)&&(i.Authorization=`Bearer ${s}`),U(r)&&U(o)){let n=J(`${r}:${o}`);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":T(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):T(t.body)||w(t.body)||B(t.body)?t.body:JSON.stringify(t.body)},ee=(t,e,s,r,o,a,i)=>m(void 0,null,function*(){let n=new AbortController,l={headers:a,body:r!=null?r:o,method:e.method,signal:n.signal};t.WITH_CREDENTIALS&&(l.credentials=t.CREDENTIALS);for(let p of t.interceptors.request._fns)l=yield p(l);return i(()=>n.abort()),yield fetch(s,l)}),te=(t,e)=>{if(e){let s=t.headers.get(e);if(T(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(r=>e.includes(r)))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)}}),re=(t,e)=>{var o,a;let r=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(r)throw new d(t,e,r);if(!e.ok){let i=(o=e.status)!=null?o:"unknown",n=(a=e.statusText)!=null?a:"unknown",l=(()=>{try{return JSON.stringify(e.body,null,2)}catch(p){return}})();throw new d(t,e,`Generic Error: status: ${i}; status text: ${n}; body: ${l}`)}},N=(t,e)=>new h((s,r,o)=>m(void 0,null,function*(){try{let a=Q(t,e),i=X(e),n=Z(e),l=yield Y(t,e);if(!o.isCancelled){let p=yield ee(t,e,a,n,i,l,o);for(let z of t.interceptors.response._fns)p=yield z(p);let q=yield se(p),I=te(p,e.responseHeader),L={url:a,ok:p.ok,status:p.status,statusText:p.statusText,body:I!=null?I:q};re(e,L),s(L.body)}}catch(a){r(a)}}));var f=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},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=f){var r,o,a,i,n,l,p,q;this.request=new s({BASE:(r=e==null?void 0:e.BASE)!=null?r:"https://api.bundle.social",VERSION:(o=e==null?void 0:e.VERSION)!=null?o:"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:(l=(n=e==null?void 0:e.interceptors)==null?void 0:n.request)!=null?l:new c,response:(q=(p=e==null?void 0:e.interceptors)==null?void 0:p.response)!=null?q: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 oe from"crypto";var H=class{constructor(){}verifySignature(e,s,r){return oe.createHmac("sha256",r).update(e).digest("hex")===s}constructEvent(e,s,r){let o=typeof e=="string"?e:JSON.stringify(e);if(!this.verifySignature(o,s,r))throw new Error("Invalid signature");return JSON.parse(o)}},k=class extends C{constructor(s,r){super(y(u({},r),{HEADERS:y(u(u({},x.HEADERS),r==null?void 0:r.HEADERS),{"x-api-key":s})}));this.webhooks=new H}};export{d as ApiError,R as BaseHttpRequest,k as Bundlesocial,b as CancelError,h as CancelablePromise,x as OpenAPI};
|