diff --git a/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts b/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts index 7c287152b9..1b2bf9aa22 100644 --- a/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts @@ -820,7 +820,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider { // by post_total_media_view_unique (unique media views = reach), available on // Graph API v23.0+. Engagement metrics below are unaffected. const { data } = await ( - await this.fetch( + await fetch( `https://graph.facebook.com/v23.0/${postId}/insights?metric=post_total_media_view_unique,post_reactions_by_type_total,post_clicks,post_clicks_by_type&access_token=${accessToken}` ) ).json(); diff --git a/libraries/nestjs-libraries/src/integrations/social/instagram.provider.ts b/libraries/nestjs-libraries/src/integrations/social/instagram.provider.ts index c96234777f..d372bd9074 100644 --- a/libraries/nestjs-libraries/src/integrations/social/instagram.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/instagram.provider.ts @@ -1037,7 +1037,7 @@ export class InstagramProvider try { // Fetch media insights from Instagram Graph API const { data } = await ( - await this.fetch( + await fetch( `https://${type}/v21.0/${postId}/insights?metric=views,reach,saved,likes,comments,shares&access_token=${accessToken}` ) ).json(); diff --git a/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts b/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts index a87f3a6fec..3c37b67a3b 100644 --- a/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts @@ -433,7 +433,7 @@ export class LinkedinPageProvider const { elements: shareElements }: { elements: PostShareStatElement[] } = await ( - await this.fetch(shareStatsUrl, { + await fetch(shareStatsUrl, { headers: { Authorization: `Bearer ${accessToken}`, 'LinkedIn-Version': '202601', @@ -449,7 +449,7 @@ export class LinkedinPageProvider postId )}`; socialActions = await ( - await this.fetch(socialActionsUrl, { + await fetch(socialActionsUrl, { headers: { Authorization: `Bearer ${accessToken}`, 'LinkedIn-Version': '202601', diff --git a/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts b/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts index a647f61e2d..ff32554bcc 100644 --- a/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts @@ -461,7 +461,7 @@ export class PinterestProvider try { // Fetch pin analytics from Pinterest API - const response = await this.fetch( + const response = await fetch( `https://api.pinterest.com/v5/pins/${postId}/analytics?start_date=${since}&end_date=${today}&metric_types=IMPRESSION,PIN_CLICK,OUTBOUND_CLICK,SAVE`, { method: 'GET', diff --git a/libraries/nestjs-libraries/src/integrations/social/threads.provider.ts b/libraries/nestjs-libraries/src/integrations/social/threads.provider.ts index 4dfd1d3fde..30092f83f6 100644 --- a/libraries/nestjs-libraries/src/integrations/social/threads.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/threads.provider.ts @@ -566,7 +566,7 @@ export class ThreadsProvider extends SocialAbstract implements SocialProvider { try { // Fetch thread insights from Threads API const { data } = await ( - await this.fetch( + await fetch( `https://graph.threads.net/v1.0/${postId}/insights?metric=views,likes,replies,reposts,quotes&access_token=${accessToken}` ) ).json(); diff --git a/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts b/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts index 475ddaf445..6838f50b7e 100644 --- a/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts @@ -860,7 +860,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { try { // Get user stats (follower_count, following_count, likes_count, video_count) - const userStatsResponse = await this.fetch( + const userStatsResponse = await fetch( 'https://open.tiktokapis.com/v2/user/info/?fields=follower_count,following_count,likes_count,video_count', { method: 'GET', @@ -910,7 +910,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { } // Get recent videos and aggregate their stats - const videoListResponse = await this.fetch( + const videoListResponse = await fetch( 'https://open.tiktokapis.com/v2/video/list/?fields=id', { method: 'POST', @@ -929,7 +929,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { const videoIds = videos.map((v: { id: string }) => v.id); // Query video details to get engagement metrics - const videoQueryResponse = await this.fetch( + const videoQueryResponse = await fetch( 'https://open.tiktokapis.com/v2/video/query/?fields=id,like_count,comment_count,share_count,view_count', { method: 'POST', @@ -1036,7 +1036,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { if (postId.indexOf('v_pub_url') > -1) { const post = await ( - await this.fetch( + await fetch( 'https://open.tiktokapis.com/v2/post/publish/status/fetch/', { method: 'POST', @@ -1047,10 +1047,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { body: JSON.stringify({ publish_id: postId, }), - }, - '', - 0, - true + } ) ).json(); @@ -1063,7 +1060,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { try { // Query video details using the video ID - const response = await this.fetch( + const response = await fetch( 'https://open.tiktokapis.com/v2/video/query/?fields=id,like_count,comment_count,share_count,view_count', { method: 'POST',