From 709dcdd57cd8236901ce58190c2dbdb4d1a9718f Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 4 Nov 2020 16:11:51 +0100 Subject: [PATCH] :zap: Minor improvements to Google Books Node --- .../nodes/Google/Books/GenericFunctions.ts | 8 +++--- .../nodes/Google/Books/GoogleBooks.node.ts | 28 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts index 6c57cd4f5f..56105c4f04 100644 --- a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts @@ -26,7 +26,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF body, qs, uri: uri || `https://www.googleapis.com/books/${resource}`, - json: true + json: true, }; try { if (Object.keys(headers).length !== 0) { @@ -67,7 +67,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF } // Try to return the error prettier throw new Error( - `Google Books error response [${error.statusCode}]: ${errors}` + `Google Books error response [${error.statusCode}]: ${errors}`, ); } throw error; @@ -117,7 +117,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa 'typ': 'JWT', 'alg': 'RS256', }, - } + }, ); const options: OptionsWithUri = { @@ -130,7 +130,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa assertion: signature, }, uri: 'https://oauth2.googleapis.com/token', - json: true + json: true, }; //@ts-ignore diff --git a/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts b/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts index b9635512f5..c8992cfe10 100644 --- a/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts +++ b/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts @@ -95,7 +95,7 @@ export class GoogleBooks implements INodeType { }, ], default: 'bookshelf', - description: 'The resource to operate on', + description: 'The resource to operate on.', }, { displayName: 'Operation', @@ -121,7 +121,7 @@ export class GoogleBooks implements INodeType { }, }, default: 'get', - description: 'The operation to perform', + description: 'The operation to perform.', }, { displayName: 'Operation', @@ -162,7 +162,7 @@ export class GoogleBooks implements INodeType { }, }, default: 'getAll', - description: 'The operation to perform', + description: 'The operation to perform.', }, { displayName: 'Operation', @@ -188,7 +188,7 @@ export class GoogleBooks implements INodeType { }, }, default: 'get', - description: 'The operation to perform', + description: 'The operation to perform.', }, { displayName: 'My Library', @@ -204,7 +204,7 @@ export class GoogleBooks implements INodeType { ], resource: [ 'bookshelf', - 'bookshelfVolume' + 'bookshelfVolume', ], }, }, @@ -217,7 +217,7 @@ export class GoogleBooks implements INodeType { displayName: 'Search Query', name: 'searchQuery', type: 'string', - description: 'Full-text search query string', + description: 'Full-text search query string.', default: '', required: true, displayOptions: { @@ -260,7 +260,7 @@ export class GoogleBooks implements INodeType { displayName: 'Bookshelf ID', name: 'shelfId', type: 'string', - description: 'ID of the bookshelf', + description: 'ID of the bookshelf.', default: '', required: true, displayOptions: { @@ -274,7 +274,7 @@ export class GoogleBooks implements INodeType { ], resource: [ 'bookshelf', - 'bookshelfVolume' + 'bookshelfVolume', ], }, }, @@ -283,7 +283,7 @@ export class GoogleBooks implements INodeType { displayName: 'Bookshelf ID', name: 'shelfId', type: 'string', - description: 'ID of the bookshelf', + description: 'ID of the bookshelf.', default: '', required: true, displayOptions: { @@ -301,7 +301,7 @@ export class GoogleBooks implements INodeType { displayName: 'Volume ID', name: 'volumeId', type: 'string', - description: 'ID of the volume', + description: 'ID of the volume.', default: '', required: true, displayOptions: { @@ -323,7 +323,7 @@ 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: { @@ -389,7 +389,7 @@ export class GoogleBooks implements INodeType { if (operation === 'get') { const volumeId = this.getNodeParameter('volumeId', i) as string; responseData = await googleApiRequest.call(this, 'GET', `v1/volumes/${volumeId}`, {}); - } else if (operation === 'getAll') { + } else if (operation === 'getAll') { const searchQuery = this.getNodeParameter('searchQuery', i) as string; const returnAll = this.getNodeParameter('returnAll', i) as boolean; if (returnAll) { @@ -399,7 +399,7 @@ export class GoogleBooks implements INodeType { responseData = await googleApiRequest.call(this, 'GET', `v1/volumes?q=${searchQuery}`, {}, qs); responseData = responseData.items || []; } - } + } } if (resource === 'bookshelf') { @@ -450,7 +450,7 @@ export class GoogleBooks implements INodeType { responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/clearVolumes`); } - if (operation === 'getAll') { + if (operation === 'getAll') { const shelfId = this.getNodeParameter('shelfId', i) as string; const returnAll = this.getNodeParameter('returnAll', i) as boolean; const myLibrary = this.getNodeParameter('myLibrary', i) as boolean;