mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Minor improvements to Gotify Node
This commit is contained in:
@@ -8,24 +8,25 @@ export class GotifyApi implements ICredentialType {
|
|||||||
displayName = 'Gotify API';
|
displayName = 'Gotify API';
|
||||||
properties = [
|
properties = [
|
||||||
{
|
{
|
||||||
displayName: 'APP API Token',
|
displayName: 'App API Token',
|
||||||
name: 'appApiToken',
|
name: 'appApiToken',
|
||||||
type: 'string' as NodePropertyTypes,
|
type: 'string' as NodePropertyTypes,
|
||||||
default: '',
|
default: '',
|
||||||
description: '(Optional) Needed for message creation',
|
description: '(Optional) Needed for message creation.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Client API Token',
|
displayName: 'Client API Token',
|
||||||
name: 'clientApiToken',
|
name: 'clientApiToken',
|
||||||
type: 'string' as NodePropertyTypes,
|
type: 'string' as NodePropertyTypes,
|
||||||
default: '',
|
default: '',
|
||||||
description: '(Optional) Needed for everything (delete, getAll) but message creation',
|
description: '(Optional) Needed for everything (delete, getAll) but message creation.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'URL',
|
displayName: 'URL',
|
||||||
name: 'url',
|
name: 'url',
|
||||||
type: 'string' as NodePropertyTypes,
|
type: 'string' as NodePropertyTypes,
|
||||||
default: `Host's URL`,
|
default: '',
|
||||||
|
description: 'The URL of the Gotify host.',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export async function gotifyApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
|||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
return await this.helpers.request.call(this, options);
|
return await this.helpers.request.call(this, options);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
if (error.response && error.response.body && error.response.body.errorDescription) {
|
if (error.response && error.response.body && error.response.body.errorDescription) {
|
||||||
const message = error.response.body.errorDescription;
|
const message = error.response.body.errorDescription;
|
||||||
// Try to return the error prettier
|
// Try to return the error prettier
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ export class Gotify implements INodeType {
|
|||||||
const body: IDataObject = {
|
const body: IDataObject = {
|
||||||
message,
|
message,
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(body, additionalFields);
|
Object.assign(body, additionalFields);
|
||||||
|
|
||||||
responseData = await gotifyApiRequest.call(
|
responseData = await gotifyApiRequest.call(
|
||||||
|
|||||||
Reference in New Issue
Block a user