n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -1,19 +1,8 @@
import { IExecuteFunctions } from 'n8n-core';
import {
IExecuteFunctions,
} from 'n8n-core';
import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
import {
IDataObject,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import {
googleApiRequest,
googleApiRequestAllItems,
} from './GenericFunctions';
import { googleApiRequest, googleApiRequestAllItems } from './GenericFunctions';
export interface IGoogleAuthCredentials {
email: string;
@@ -40,9 +29,7 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
authentication: [
'serviceAccount',
],
authentication: ['serviceAccount'],
},
},
},
@@ -51,9 +38,7 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
authentication: [
'oAuth2',
],
authentication: ['oAuth2'],
},
},
},
@@ -76,9 +61,7 @@ export class GoogleBooks implements INodeType {
default: 'serviceAccount',
displayOptions: {
show: {
'@version': [
1,
],
'@version': [1],
},
},
},
@@ -99,9 +82,7 @@ export class GoogleBooks implements INodeType {
default: 'oAuth2',
displayOptions: {
show: {
'@version': [
2,
],
'@version': [2],
},
},
},
@@ -147,9 +128,7 @@ export class GoogleBooks implements INodeType {
],
displayOptions: {
show: {
resource: [
'bookshelf',
],
resource: ['bookshelf'],
},
},
default: 'get',
@@ -193,9 +172,7 @@ export class GoogleBooks implements INodeType {
],
displayOptions: {
show: {
resource: [
'bookshelfVolume',
],
resource: ['bookshelfVolume'],
},
},
default: 'getAll',
@@ -221,9 +198,7 @@ export class GoogleBooks implements INodeType {
],
displayOptions: {
show: {
resource: [
'volume',
],
resource: ['volume'],
},
},
default: 'get',
@@ -236,14 +211,8 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'get',
'getAll',
],
resource: [
'bookshelf',
'bookshelfVolume',
],
operation: ['get', 'getAll'],
resource: ['bookshelf', 'bookshelfVolume'],
},
},
},
@@ -260,12 +229,8 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'volume',
],
operation: ['getAll'],
resource: ['volume'],
},
},
},
@@ -278,19 +243,11 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'get',
'getAll',
],
resource: [
'bookshelf',
'bookshelfVolume',
],
operation: ['get', 'getAll'],
resource: ['bookshelf', 'bookshelfVolume'],
},
hide: {
myLibrary: [
true,
],
myLibrary: [true],
},
},
},
@@ -303,17 +260,8 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'get',
'add',
'clear',
'move',
'remove',
],
resource: [
'bookshelf',
'bookshelfVolume',
],
operation: ['get', 'add', 'clear', 'move', 'remove'],
resource: ['bookshelf', 'bookshelfVolume'],
},
},
},
@@ -326,12 +274,8 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'bookshelfVolume',
],
operation: ['getAll'],
resource: ['bookshelfVolume'],
},
},
},
@@ -344,16 +288,8 @@ export class GoogleBooks implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'add',
'move',
'remove',
'get',
],
resource: [
'bookshelfVolume',
'volume',
],
operation: ['add', 'move', 'remove', 'get'],
resource: ['bookshelfVolume', 'volume'],
},
},
},
@@ -361,17 +297,14 @@ export class GoogleBooks implements INodeType {
displayName: 'Volume Position',
name: 'volumePosition',
type: 'string',
description: 'Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on)',
description:
'Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on)',
default: '',
required: true,
displayOptions: {
show: {
operation: [
'move',
],
resource: [
'bookshelfVolume',
],
operation: ['move'],
resource: ['bookshelfVolume'],
},
},
},
@@ -381,9 +314,7 @@ export class GoogleBooks implements INodeType {
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
operation: ['getAll'],
},
},
default: false,
@@ -395,12 +326,8 @@ export class GoogleBooks implements INodeType {
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
returnAll: [
false,
],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
@@ -424,7 +351,6 @@ export class GoogleBooks implements INodeType {
for (let i = 0; i < length; i++) {
try {
if (resource === 'volume') {
if (operation === 'get') {
const volumeId = this.getNodeParameter('volumeId', i) as string;
@@ -433,10 +359,22 @@ export class GoogleBooks implements INodeType {
const searchQuery = this.getNodeParameter('searchQuery', i) as string;
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
if (returnAll) {
responseData = await googleApiRequestAllItems.call(this, 'items', 'GET', `v1/volumes?q=${searchQuery}`, {});
responseData = await googleApiRequestAllItems.call(
this,
'items',
'GET',
`v1/volumes?q=${searchQuery}`,
{},
);
} else {
qs.maxResults = this.getNodeParameter('limit', i) as number;
responseData = await googleApiRequest.call(this, 'GET', `v1/volumes?q=${searchQuery}`, {}, qs);
responseData = await googleApiRequest.call(
this,
'GET',
`v1/volumes?q=${searchQuery}`,
{},
qs,
);
responseData = responseData.items || [];
}
}
@@ -466,7 +404,13 @@ export class GoogleBooks implements INodeType {
endpoint = `v1/mylibrary/bookshelves`;
}
if (returnAll) {
responseData = await googleApiRequestAllItems.call(this, 'items', 'GET', endpoint, {});
responseData = await googleApiRequestAllItems.call(
this,
'items',
'GET',
endpoint,
{},
);
} else {
qs.maxResults = this.getNodeParameter('limit', i) as number;
responseData = await googleApiRequest.call(this, 'GET', endpoint, {}, qs);
@@ -482,12 +426,21 @@ export class GoogleBooks implements INodeType {
const body: IDataObject = {
volumeId,
};
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/addVolume`, body);
responseData = await googleApiRequest.call(
this,
'POST',
`v1/mylibrary/bookshelves/${shelfId}/addVolume`,
body,
);
}
if (operation === 'clear') {
const shelfId = this.getNodeParameter('shelfId', i) as string;
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/clearVolumes`);
responseData = await googleApiRequest.call(
this,
'POST',
`v1/mylibrary/bookshelves/${shelfId}/clearVolumes`,
);
}
if (operation === 'getAll') {
@@ -502,7 +455,13 @@ export class GoogleBooks implements INodeType {
endpoint = `v1/mylibrary/bookshelves/${shelfId}/volumes`;
}
if (returnAll) {
responseData = await googleApiRequestAllItems.call(this, 'items', 'GET', endpoint, {});
responseData = await googleApiRequestAllItems.call(
this,
'items',
'GET',
endpoint,
{},
);
} else {
qs.maxResults = this.getNodeParameter('limit', i) as number;
responseData = await googleApiRequest.call(this, 'GET', endpoint, {}, qs);
@@ -518,7 +477,12 @@ export class GoogleBooks implements INodeType {
volumeId,
volumePosition,
};
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/moveVolume`, body);
responseData = await googleApiRequest.call(
this,
'POST',
`v1/mylibrary/bookshelves/${shelfId}/moveVolume`,
body,
);
}
if (operation === 'remove') {
@@ -527,7 +491,12 @@ export class GoogleBooks implements INodeType {
const body: IDataObject = {
volumeId,
};
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/removeVolume`, body);
responseData = await googleApiRequest.call(
this,
'POST',
`v1/mylibrary/bookshelves/${shelfId}/removeVolume`,
body,
);
}
}
if (Array.isArray(responseData)) {
@@ -535,7 +504,6 @@ export class GoogleBooks implements INodeType {
} else {
returnData.push(responseData as IDataObject);
}
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ error: error.message });