n8n/packages/nodes-base/credentials/GoogleAdsOAuth2Api.credentials.ts

25 lines
568 B
TypeScript
Raw Normal View History

import { ICredentialType, INodeProperties } from 'n8n-workflow';
feat(Google Ads Node): Add new node (#3526) * Add basic layout with icon for Google Ads * Add node versioning(V1) * Add node and credential to package * Add basic layout with icon for Google Ads * Add node versioning(V1) * Add node and credential to package * Add api call to getall * Fix formdata in the body for the request * N8N-2928 Added custom queries to campaign * Fix header bug and add developer-token field * Add operation and fields to campaign new format * Add more configurations and queries * Add Invoice ressources and operations * Remov old version from the node * Fixed bud with typo * Correctly prepends the baseURL * add query to invocie request * Fixes header not parsing the expression * Invoice param changes * Fixes bug related to headers not being parsed, and bug with auth * Remove useless imports * Added analytics to google ad node and removed useless header * Removed url for testing * Fixed inconsistent behaviour with the access token not being refreshed * Added placeholders to help user * Removed useless comments * Resolved name confusion * Added support for body in a GET method * Removed hyphens, parse body's expression * Renamed operation for clarity * Remove unused code * Removed invoice resource and fixed bug with body and headers The invoice operation was removed since it does not reflect what a user would expect from it. Google ADS invoices are only used for big advertisers where invoicing is performed after the end of the month and for big sums. This would be misleading for the majority of the users expecting an expenses report. Also fixed a bug with header and body being sent since it was broken for multiple input rows. The first execution would override all others. Lastly, made some improvements to the node itself by transforming data, adding filters and operations. * Improve campagin operation and remove analytics; fix tests * Improve tooltips and descriptions * Fix lint issues * Improve tooltip to explain amounts in micros * Change wording for micros * Change the fix to a more elegant solution Co-authored-by: Cyril Gobrecht <cyril.gobrecht@gmail.com> Co-authored-by: Aël Gobrecht <ael.gobrecht@gmail.com>
2022-07-04 13:47:50 -07:00
const scopes = ['https://www.googleapis.com/auth/adwords'];
feat(Google Ads Node): Add new node (#3526) * Add basic layout with icon for Google Ads * Add node versioning(V1) * Add node and credential to package * Add basic layout with icon for Google Ads * Add node versioning(V1) * Add node and credential to package * Add api call to getall * Fix formdata in the body for the request * N8N-2928 Added custom queries to campaign * Fix header bug and add developer-token field * Add operation and fields to campaign new format * Add more configurations and queries * Add Invoice ressources and operations * Remov old version from the node * Fixed bud with typo * Correctly prepends the baseURL * add query to invocie request * Fixes header not parsing the expression * Invoice param changes * Fixes bug related to headers not being parsed, and bug with auth * Remove useless imports * Added analytics to google ad node and removed useless header * Removed url for testing * Fixed inconsistent behaviour with the access token not being refreshed * Added placeholders to help user * Removed useless comments * Resolved name confusion * Added support for body in a GET method * Removed hyphens, parse body's expression * Renamed operation for clarity * Remove unused code * Removed invoice resource and fixed bug with body and headers The invoice operation was removed since it does not reflect what a user would expect from it. Google ADS invoices are only used for big advertisers where invoicing is performed after the end of the month and for big sums. This would be misleading for the majority of the users expecting an expenses report. Also fixed a bug with header and body being sent since it was broken for multiple input rows. The first execution would override all others. Lastly, made some improvements to the node itself by transforming data, adding filters and operations. * Improve campagin operation and remove analytics; fix tests * Improve tooltips and descriptions * Fix lint issues * Improve tooltip to explain amounts in micros * Change wording for micros * Change the fix to a more elegant solution Co-authored-by: Cyril Gobrecht <cyril.gobrecht@gmail.com> Co-authored-by: Aël Gobrecht <ael.gobrecht@gmail.com>
2022-07-04 13:47:50 -07:00
export class GoogleAdsOAuth2Api implements ICredentialType {
name = 'googleAdsOAuth2Api';
extends = ['googleOAuth2Api'];
feat(Google Ads Node): Add new node (#3526) * Add basic layout with icon for Google Ads * Add node versioning(V1) * Add node and credential to package * Add basic layout with icon for Google Ads * Add node versioning(V1) * Add node and credential to package * Add api call to getall * Fix formdata in the body for the request * N8N-2928 Added custom queries to campaign * Fix header bug and add developer-token field * Add operation and fields to campaign new format * Add more configurations and queries * Add Invoice ressources and operations * Remov old version from the node * Fixed bud with typo * Correctly prepends the baseURL * add query to invocie request * Fixes header not parsing the expression * Invoice param changes * Fixes bug related to headers not being parsed, and bug with auth * Remove useless imports * Added analytics to google ad node and removed useless header * Removed url for testing * Fixed inconsistent behaviour with the access token not being refreshed * Added placeholders to help user * Removed useless comments * Resolved name confusion * Added support for body in a GET method * Removed hyphens, parse body's expression * Renamed operation for clarity * Remove unused code * Removed invoice resource and fixed bug with body and headers The invoice operation was removed since it does not reflect what a user would expect from it. Google ADS invoices are only used for big advertisers where invoicing is performed after the end of the month and for big sums. This would be misleading for the majority of the users expecting an expenses report. Also fixed a bug with header and body being sent since it was broken for multiple input rows. The first execution would override all others. Lastly, made some improvements to the node itself by transforming data, adding filters and operations. * Improve campagin operation and remove analytics; fix tests * Improve tooltips and descriptions * Fix lint issues * Improve tooltip to explain amounts in micros * Change wording for micros * Change the fix to a more elegant solution Co-authored-by: Cyril Gobrecht <cyril.gobrecht@gmail.com> Co-authored-by: Aël Gobrecht <ael.gobrecht@gmail.com>
2022-07-04 13:47:50 -07:00
displayName = 'Google Ads OAuth2 API';
documentationUrl = 'google';
properties: INodeProperties[] = [
{
displayName: 'Developer Token',
name: 'developerToken',
type: 'string',
default: '',
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: scopes.join(' '),
},
];
}