mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
⚡ Minor improvements to Google Books Node
This commit is contained in:
@@ -26,7 +26,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
|||||||
body,
|
body,
|
||||||
qs,
|
qs,
|
||||||
uri: uri || `https://www.googleapis.com/books/${resource}`,
|
uri: uri || `https://www.googleapis.com/books/${resource}`,
|
||||||
json: true
|
json: true,
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
if (Object.keys(headers).length !== 0) {
|
if (Object.keys(headers).length !== 0) {
|
||||||
@@ -67,7 +67,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
|||||||
}
|
}
|
||||||
// Try to return the error prettier
|
// Try to return the error prettier
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Google Books error response [${error.statusCode}]: ${errors}`
|
`Google Books error response [${error.statusCode}]: ${errors}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
@@ -117,7 +117,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
|
|||||||
'typ': 'JWT',
|
'typ': 'JWT',
|
||||||
'alg': 'RS256',
|
'alg': 'RS256',
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const options: OptionsWithUri = {
|
const options: OptionsWithUri = {
|
||||||
@@ -130,7 +130,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
|
|||||||
assertion: signature,
|
assertion: signature,
|
||||||
},
|
},
|
||||||
uri: 'https://oauth2.googleapis.com/token',
|
uri: 'https://oauth2.googleapis.com/token',
|
||||||
json: true
|
json: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'bookshelf',
|
default: 'bookshelf',
|
||||||
description: 'The resource to operate on',
|
description: 'The resource to operate on.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
@@ -121,7 +121,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: 'get',
|
default: 'get',
|
||||||
description: 'The operation to perform',
|
description: 'The operation to perform.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
@@ -162,7 +162,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: 'getAll',
|
default: 'getAll',
|
||||||
description: 'The operation to perform',
|
description: 'The operation to perform.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
@@ -188,7 +188,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: 'get',
|
default: 'get',
|
||||||
description: 'The operation to perform',
|
description: 'The operation to perform.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'My Library',
|
displayName: 'My Library',
|
||||||
@@ -204,7 +204,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
],
|
],
|
||||||
resource: [
|
resource: [
|
||||||
'bookshelf',
|
'bookshelf',
|
||||||
'bookshelfVolume'
|
'bookshelfVolume',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -217,7 +217,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
displayName: 'Search Query',
|
displayName: 'Search Query',
|
||||||
name: 'searchQuery',
|
name: 'searchQuery',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'Full-text search query string',
|
description: 'Full-text search query string.',
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
@@ -260,7 +260,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
displayName: 'Bookshelf ID',
|
displayName: 'Bookshelf ID',
|
||||||
name: 'shelfId',
|
name: 'shelfId',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'ID of the bookshelf',
|
description: 'ID of the bookshelf.',
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
@@ -274,7 +274,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
],
|
],
|
||||||
resource: [
|
resource: [
|
||||||
'bookshelf',
|
'bookshelf',
|
||||||
'bookshelfVolume'
|
'bookshelfVolume',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -283,7 +283,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
displayName: 'Bookshelf ID',
|
displayName: 'Bookshelf ID',
|
||||||
name: 'shelfId',
|
name: 'shelfId',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'ID of the bookshelf',
|
description: 'ID of the bookshelf.',
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
@@ -301,7 +301,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
displayName: 'Volume ID',
|
displayName: 'Volume ID',
|
||||||
name: 'volumeId',
|
name: 'volumeId',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'ID of the volume',
|
description: 'ID of the volume.',
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
@@ -323,7 +323,7 @@ export class GoogleBooks implements INodeType {
|
|||||||
displayName: 'Volume Position',
|
displayName: 'Volume Position',
|
||||||
name: 'volumePosition',
|
name: 'volumePosition',
|
||||||
type: 'string',
|
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<br />current first item, 1 puts it between the first and the second and so on).',
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
|||||||
Reference in New Issue
Block a user