Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

fix(vk): call VK ID and VK API on the vk.ru domains

Gilad Resisi5a5da1aed419
diff --git a/libraries/nestjs-libraries/src/integrations/social/vk.provider.ts b/libraries/nestjs-libraries/src/integrations/social/vk.provider.ts
index c3eaff83e..51df2045b 100644
--- a/libraries/nestjs-libraries/src/integrations/social/vk.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/vk.provider.ts
@@ -48,7 +48,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
formData.append('scope', this.scopes.join(' '));
const { access_token, refresh_token, expires_in } = await (
- await this.fetch('https://id.vk.com/oauth2/auth', {
+ await this.fetch('https://id.vk.ru/oauth2/auth', {
method: 'POST',
body: formData,
})
@@ -61,7 +61,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
const {
user: { user_id, first_name, last_name, avatar },
} = await (
- await this.fetch('https://id.vk.com/oauth2/user_info', {
+ await this.fetch('https://id.vk.ru/oauth2/user_info', {
method: 'POST',
body: newFormData,
})
@@ -91,7 +91,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
return {
url:
- 'https://id.vk.com/authorize' +
+ 'https://id.vk.ru/authorize' +
`?response_type=code` +
`&client_id=${process.env.VK_ID}` +
`&code_challenge_method=S256` +
@@ -133,7 +133,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
);
const { access_token, scope, refresh_token, expires_in } = await (
- await this.fetch('https://id.vk.com/oauth2/auth', {
+ await this.fetch('https://id.vk.ru/oauth2/auth', {
method: 'POST',
body: formData,
})
@@ -146,7 +146,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
const {
user: { user_id, first_name, last_name, avatar },
} = await (
- await this.fetch('https://id.vk.com/oauth2/user_info', {
+ await this.fetch('https://id.vk.ru/oauth2/user_info', {
method: 'POST',
body: newFormData,
})
@@ -173,8 +173,8 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
const all = await (
await this.fetch(
hasExtension(media.path, 'mp4')
- ? `https://api.vk.com/method/video.save?access_token=${accessToken}&v=5.251`
- : `https://api.vk.com/method/photos.getWallUploadServer?owner_id=${userId}&access_token=${accessToken}&v=5.251`
+ ? `https://api.vk.ru/method/video.save?access_token=${accessToken}&v=5.251`
+ : `https://api.vk.ru/method/photos.getWallUploadServer?owner_id=${userId}&access_token=${accessToken}&v=5.251`
)
).json();
this.checkApiError(all);
@@ -216,7 +216,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
const saved = await (
await fetch(
- `https://api.vk.com/method/photos.saveWallPhoto?access_token=${accessToken}&v=5.251`,
+ `https://api.vk.ru/method/photos.saveWallPhoto?access_token=${accessToken}&v=5.251`,
{
method: 'POST',
body: formSend,
@@ -273,7 +273,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
const all = await (
await this.fetch(
- `https://api.vk.com/method/wall.post?v=5.251&access_token=${accessToken}&client_id=${process.env.VK_ID}`,
+ `https://api.vk.ru/method/wall.post?v=5.251&access_token=${accessToken}&client_id=${process.env.VK_ID}`,
{
method: 'POST',
body,
@@ -319,7 +319,7 @@ export class VkProvider extends SocialAbstract implements SocialProvider {
const all = await (
await this.fetch(
- `https://api.vk.com/method/wall.createComment?v=5.251&access_token=${accessToken}&client_id=${process.env.VK_ID}`,
+ `https://api.vk.ru/method/wall.createComment?v=5.251&access_token=${accessToken}&client_id=${process.env.VK_ID}`,
{
method: 'POST',
body,