docs: Rename Google My Business > Google Business Profile (no-changelog) (#11361)

This commit is contained in:
Jon 2024-10-23 12:02:16 +01:00 committed by GitHub
parent 5390061f49
commit 992547baf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 71 additions and 69 deletions

View file

@ -0,0 +1,29 @@
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
const scopes = ['https://www.googleapis.com/auth/business.manage'];
export class GoogleBusinessProfileOAuth2Api implements ICredentialType {
name = 'googleBusinessProfileOAuth2Api';
extends = ['googleOAuth2Api'];
displayName = 'Google Business Profile OAuth2 API';
documentationUrl = 'google/oauth-single-service';
properties: INodeProperties[] = [
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: scopes.join(' '),
},
{
displayName:
'Make sure that you have fulfilled the prerequisites and requested access to Google Business Profile API. <a href="https://developers.google.com/my-business/content/prereqs" target="_blank">More info</a>. Also, make sure that you have enabled the following APIs & Services in the Google Cloud Console: Google My Business API, Google My Business Management API. <a href="https://docs.n8n.io/integrations/builtin/credentials/google/oauth-generic/#scopes" target="_blank">More info</a>.',
name: 'notice',
type: 'notice',
default: '',
},
];
}

View file

@ -1,29 +0,0 @@
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
const scopes = ['https://www.googleapis.com/auth/business.manage'];
export class GoogleMyBusinessOAuth2Api implements ICredentialType {
name = 'googleMyBusinessOAuth2Api';
extends = ['googleOAuth2Api'];
displayName = 'Google My Business OAuth2 API';
documentationUrl = 'google/oauth-single-service';
properties: INodeProperties[] = [
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: scopes.join(' '),
},
{
displayName:
'Make sure that you have fulfilled the prerequisites and requested access to Google My Business API. <a href="https://developers.google.com/my-business/content/prereqs" target="_blank">More info</a>. Also, make sure that you have enabled the following APIs & Services in the Google Cloud Console: Google My Business API, Google My Business Management API. <a href="https://docs.n8n.io/integrations/builtin/credentials/google/oauth-generic/#scopes" target="_blank">More info</a>.',
name: 'notice',
type: 'notice',
default: '',
},
];
}

View file

@ -337,7 +337,7 @@ export async function googleApiRequest(
return (await this.helpers.httpRequestWithAuthentication.call( return (await this.helpers.httpRequestWithAuthentication.call(
this, this,
'googleMyBusinessOAuth2Api', 'googleBusinessProfileOAuth2Api',
options, options,
)) as IDataObject; )) as IDataObject;
} catch (error) { } catch (error) {

View file

@ -1,5 +1,5 @@
{ {
"node": "n8n-nodes-base.googleMyBusiness", "node": "n8n-nodes-base.googleBusinessProfile",
"nodeVersion": "1.0", "nodeVersion": "1.0",
"codexVersion": "1.0", "codexVersion": "1.0",
"categories": ["Marketing", "Productivity"], "categories": ["Marketing", "Productivity"],
@ -11,8 +11,9 @@
], ],
"primaryDocumentation": [ "primaryDocumentation": [
{ {
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlemybusiness/" "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlebusinessprofile/"
} }
] ]
} },
"alias": ["Google My Business", "GMB", "My Business"]
} }

View file

@ -4,17 +4,17 @@ import { searchAccounts, searchLocations, searchPosts, searchReviews } from './G
import { postFields, postOperations } from './PostDescription'; import { postFields, postOperations } from './PostDescription';
import { reviewFields, reviewOperations } from './ReviewDescription'; import { reviewFields, reviewOperations } from './ReviewDescription';
export class GoogleMyBusiness implements INodeType { export class GoogleBusinessProfile implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
displayName: 'Google My Business', displayName: 'Google Business Profile',
name: 'googleMyBusiness', name: 'googleBusinessProfile',
icon: 'file:googleMyBusines.svg', icon: 'file:googleBusinessProfile.svg',
group: ['input'], group: ['input'],
version: 1, version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Google My Business API', description: 'Consume Google Business Profile API',
defaults: { defaults: {
name: 'Google My Business', name: 'Google Business Profile',
}, },
inputs: [NodeConnectionType.Main], inputs: [NodeConnectionType.Main],
outputs: [NodeConnectionType.Main], outputs: [NodeConnectionType.Main],
@ -30,7 +30,7 @@ export class GoogleMyBusiness implements INodeType {
], ],
credentials: [ credentials: [
{ {
name: 'googleMyBusinessOAuth2Api', name: 'googleBusinessProfileOAuth2Api',
required: true, required: true,
}, },
], ],

View file

@ -1,5 +1,5 @@
{ {
"node": "n8n-nodes-base.googleMyBusinessTrigger", "node": "n8n-nodes-base.googleBusinessProfileTrigger",
"nodeVersion": "1.0", "nodeVersion": "1.0",
"codexVersion": "1.0", "codexVersion": "1.0",
"categories": ["Communication"], "categories": ["Communication"],
@ -11,8 +11,9 @@
], ],
"primaryDocumentation": [ "primaryDocumentation": [
{ {
"url": "https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.googlemybusinesstrigger/" "url": "https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.googlebusinessprofiletrigger/"
} }
] ]
} },
"alias": ["Google My Business", "GMB", "My Business"]
} }

View file

@ -10,22 +10,22 @@ import {
import { googleApiRequest, searchAccounts, searchLocations } from './GenericFunctions'; import { googleApiRequest, searchAccounts, searchLocations } from './GenericFunctions';
export class GoogleMyBusinessTrigger implements INodeType { export class GoogleBusinessProfileTrigger implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
displayName: 'Google My Business Trigger', displayName: 'Google Business Profile Trigger',
name: 'googleMyBusinessTrigger', name: 'googleBusinessProfileTrigger',
icon: 'file:googleMyBusines.svg', icon: 'file:googleBusinessProfile.svg',
group: ['trigger'], group: ['trigger'],
version: 1, version: 1,
description: description:
'Fetches reviews from Google My Business and starts the workflow on specified polling intervals.', 'Fetches reviews from Google Business Profile and starts the workflow on specified polling intervals.',
subtitle: '={{"Google My Business Trigger"}}', subtitle: '={{"Google Business Profile Trigger"}}',
defaults: { defaults: {
name: 'Google My Business Trigger', name: 'Google Business Profile Trigger',
}, },
credentials: [ credentials: [
{ {
name: 'googleMyBusinessOAuth2Api', name: 'googleBusinessProfileOAuth2Api',
required: true, required: true,
}, },
], ],
@ -53,7 +53,7 @@ export class GoogleMyBusinessTrigger implements INodeType {
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { event: ['reviewAdded'] } }, displayOptions: { show: { event: ['reviewAdded'] } },
modes: [ modes: [
{ {

View file

@ -22,7 +22,7 @@ export const postOperations: INodeProperties[] = [
name: 'Create', name: 'Create',
value: 'create', value: 'create',
action: 'Create post', action: 'Create post',
description: 'Create a new post on Google My Business', description: 'Create a new post on Google Business Profile',
routing: { routing: {
send: { preSend: [handleDatesPresend] }, send: { preSend: [handleDatesPresend] },
request: { request: {
@ -114,7 +114,7 @@ export const postFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['post'], operation: ['create'] } }, displayOptions: { show: { resource: ['post'], operation: ['create'] } },
modes: [ modes: [
{ {
@ -417,7 +417,7 @@ export const postFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['post'], operation: ['delete'] } }, displayOptions: { show: { resource: ['post'], operation: ['delete'] } },
modes: [ modes: [
{ {
@ -528,7 +528,7 @@ export const postFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['post'], operation: ['get'] } }, displayOptions: { show: { resource: ['post'], operation: ['get'] } },
modes: [ modes: [
{ {
@ -639,7 +639,7 @@ export const postFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['post'], operation: ['getAll'] } }, displayOptions: { show: { resource: ['post'], operation: ['getAll'] } },
modes: [ modes: [
{ {
@ -734,7 +734,7 @@ export const postFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['post'], operation: ['update'] } }, displayOptions: { show: { resource: ['post'], operation: ['update'] } },
modes: [ modes: [
{ {

View file

@ -36,7 +36,7 @@ export const reviewOperations: INodeProperties[] = [
name: 'Get', name: 'Get',
value: 'get', value: 'get',
action: 'Get review', action: 'Get review',
description: 'Retrieve details of a specific review on Google My Business', description: 'Retrieve details of a specific review on Google Business Profile',
routing: { routing: {
request: { request: {
method: 'GET', method: 'GET',
@ -97,7 +97,7 @@ export const reviewFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['review'], operation: ['get'] } }, displayOptions: { show: { resource: ['review'], operation: ['get'] } },
modes: [ modes: [
{ {
@ -223,7 +223,7 @@ export const reviewFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['review'], operation: ['delete'] } }, displayOptions: { show: { resource: ['review'], operation: ['delete'] } },
modes: [ modes: [
{ {
@ -349,7 +349,7 @@ export const reviewFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['review'], operation: ['getAll'] } }, displayOptions: { show: { resource: ['review'], operation: ['getAll'] } },
modes: [ modes: [
{ {
@ -445,7 +445,7 @@ export const reviewFields: INodeProperties[] = [
required: true, required: true,
type: 'resourceLocator', type: 'resourceLocator',
default: { mode: 'list', value: '' }, default: { mode: 'list', value: '' },
description: 'The Google My Business account', description: 'The Google Business Profile account',
displayOptions: { show: { resource: ['review'], operation: ['reply'] } }, displayOptions: { show: { resource: ['review'], operation: ['reply'] } },
modes: [ modes: [
{ {

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -22,7 +22,7 @@ describe('googleApiRequest', () => {
const result = await googleApiRequest.call(mockContext, 'GET', '/test-resource'); const result = await googleApiRequest.call(mockContext, 'GET', '/test-resource');
expect(mockHttpRequestWithAuthentication).toHaveBeenCalledWith( expect(mockHttpRequestWithAuthentication).toHaveBeenCalledWith(
'googleMyBusinessOAuth2Api', 'googleBusinessProfileOAuth2Api',
expect.objectContaining({ expect.objectContaining({
method: 'GET', method: 'GET',
url: 'https://mybusiness.googleapis.com/v4/test-resource', url: 'https://mybusiness.googleapis.com/v4/test-resource',
@ -42,7 +42,7 @@ describe('googleApiRequest', () => {
const result = await googleApiRequest.call(mockContext, 'POST', '/test-resource', requestBody); const result = await googleApiRequest.call(mockContext, 'POST', '/test-resource', requestBody);
expect(mockHttpRequestWithAuthentication).toHaveBeenCalledWith( expect(mockHttpRequestWithAuthentication).toHaveBeenCalledWith(
'googleMyBusinessOAuth2Api', 'googleBusinessProfileOAuth2Api',
expect.objectContaining({ expect.objectContaining({
method: 'POST', method: 'POST',
body: requestBody, body: requestBody,
@ -62,7 +62,7 @@ describe('googleApiRequest', () => {
const result = await googleApiRequest.call(mockContext, 'GET', '/test-resource', {}); const result = await googleApiRequest.call(mockContext, 'GET', '/test-resource', {});
expect(mockHttpRequestWithAuthentication).toHaveBeenCalledWith( expect(mockHttpRequestWithAuthentication).toHaveBeenCalledWith(
'googleMyBusinessOAuth2Api', 'googleBusinessProfileOAuth2Api',
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
expect.not.objectContaining({ body: expect.anything() }), expect.not.objectContaining({ body: expect.anything() }),
); );

View file

@ -140,7 +140,7 @@
"dist/credentials/GoogleDriveOAuth2Api.credentials.js", "dist/credentials/GoogleDriveOAuth2Api.credentials.js",
"dist/credentials/GoogleFirebaseCloudFirestoreOAuth2Api.credentials.js", "dist/credentials/GoogleFirebaseCloudFirestoreOAuth2Api.credentials.js",
"dist/credentials/GoogleFirebaseRealtimeDatabaseOAuth2Api.credentials.js", "dist/credentials/GoogleFirebaseRealtimeDatabaseOAuth2Api.credentials.js",
"dist/credentials/GoogleMyBusinessOAuth2Api.credentials.js", "dist/credentials/GoogleBusinessProfileOAuth2Api.credentials.js",
"dist/credentials/GoogleOAuth2Api.credentials.js", "dist/credentials/GoogleOAuth2Api.credentials.js",
"dist/credentials/GooglePerspectiveOAuth2Api.credentials.js", "dist/credentials/GooglePerspectiveOAuth2Api.credentials.js",
"dist/credentials/GoogleSheetsOAuth2Api.credentials.js", "dist/credentials/GoogleSheetsOAuth2Api.credentials.js",
@ -540,8 +540,8 @@
"dist/nodes/Google/Gmail/Gmail.node.js", "dist/nodes/Google/Gmail/Gmail.node.js",
"dist/nodes/Google/Gmail/GmailTrigger.node.js", "dist/nodes/Google/Gmail/GmailTrigger.node.js",
"dist/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.js", "dist/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.js",
"dist/nodes/Google/MyBusiness/GoogleMyBusiness.node.js", "dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.js",
"dist/nodes/Google/MyBusiness/GoogleMyBusinessTrigger.node.js", "dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.js",
"dist/nodes/Google/Perspective/GooglePerspective.node.js", "dist/nodes/Google/Perspective/GooglePerspective.node.js",
"dist/nodes/Google/Sheet/GoogleSheets.node.js", "dist/nodes/Google/Sheet/GoogleSheets.node.js",
"dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js", "dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js",