mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IBinaryData,
|
||||
@@ -14,9 +12,7 @@ import {
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
pushoverApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { pushoverApiRequest } from './GenericFunctions';
|
||||
|
||||
export class Pushover implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -59,9 +55,7 @@ export class Pushover implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'message',
|
||||
],
|
||||
resource: ['message'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -80,16 +74,13 @@ export class Pushover implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'message',
|
||||
],
|
||||
operation: [
|
||||
'push',
|
||||
],
|
||||
resource: ['message'],
|
||||
operation: ['push'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The user/group key (not e-mail address) of your user (or you), viewable when logged into the <a href="https://pushover.net/">dashboard</a> (often referred to as <code>USER_KEY</code> in the <a href="https://support.pushover.net/i44-example-code-and-pushover-libraries">libraries</a> and code examples)',
|
||||
description:
|
||||
'The user/group key (not e-mail address) of your user (or you), viewable when logged into the <a href="https://pushover.net/">dashboard</a> (often referred to as <code>USER_KEY</code> in the <a href="https://support.pushover.net/i44-example-code-and-pushover-libraries">libraries</a> and code examples)',
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
@@ -98,12 +89,8 @@ export class Pushover implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'message',
|
||||
],
|
||||
operation: [
|
||||
'push',
|
||||
],
|
||||
resource: ['message'],
|
||||
operation: ['push'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
@@ -116,12 +103,8 @@ export class Pushover implements INodeType {
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'message',
|
||||
],
|
||||
operation: [
|
||||
'push',
|
||||
],
|
||||
resource: ['message'],
|
||||
operation: ['push'],
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
|
||||
@@ -148,7 +131,8 @@ export class Pushover implements INodeType {
|
||||
},
|
||||
],
|
||||
default: -2,
|
||||
description: 'Send as -2 to generate no notification/alert, -1 to always send as a quiet notification, 1 to display as high-priority and bypass the user\'s quiet hours, or 2 to also require confirmation from the user',
|
||||
description:
|
||||
"Send as -2 to generate no notification/alert, -1 to always send as a quiet notification, 1 to display as high-priority and bypass the user's quiet hours, or 2 to also require confirmation from the user",
|
||||
},
|
||||
{
|
||||
displayName: 'Retry (Seconds)',
|
||||
@@ -160,19 +144,14 @@ export class Pushover implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'message',
|
||||
],
|
||||
operation: [
|
||||
'push',
|
||||
],
|
||||
priority: [
|
||||
2,
|
||||
],
|
||||
resource: ['message'],
|
||||
operation: ['push'],
|
||||
priority: [2],
|
||||
},
|
||||
},
|
||||
default: 30,
|
||||
description: 'Specifies how often (in seconds) the Pushover servers will send the same notification to the user. This parameter must have a value of at least 30 seconds between retries.',
|
||||
description:
|
||||
'Specifies how often (in seconds) the Pushover servers will send the same notification to the user. This parameter must have a value of at least 30 seconds between retries.',
|
||||
},
|
||||
{
|
||||
displayName: 'Expire (Seconds)',
|
||||
@@ -185,19 +164,14 @@ export class Pushover implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'message',
|
||||
],
|
||||
operation: [
|
||||
'push',
|
||||
],
|
||||
priority: [
|
||||
2,
|
||||
],
|
||||
resource: ['message'],
|
||||
operation: ['push'],
|
||||
priority: [2],
|
||||
},
|
||||
},
|
||||
default: 30,
|
||||
description: 'Specifies how many seconds your notification will continue to be retried for (every retry seconds)',
|
||||
description:
|
||||
'Specifies how many seconds your notification will continue to be retried for (every retry seconds)',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
@@ -206,12 +180,8 @@ export class Pushover implements INodeType {
|
||||
placeholder: 'Add Field',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'message',
|
||||
],
|
||||
operation: [
|
||||
'push',
|
||||
],
|
||||
resource: ['message'],
|
||||
operation: ['push'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
@@ -235,7 +205,8 @@ export class Pushover implements INodeType {
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'data',
|
||||
description: 'Name of the binary properties which contain data which should be added to email as attachment',
|
||||
description:
|
||||
'Name of the binary properties which contain data which should be added to email as attachment',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -247,7 +218,8 @@ export class Pushover implements INodeType {
|
||||
name: 'device',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Your user\'s device name to send the message directly to that device, rather than all of the user\'s devices (multiple devices may be separated by a comma)',
|
||||
description:
|
||||
"Your user's device name to send the message directly to that device, rather than all of the user's devices (multiple devices may be separated by a comma)",
|
||||
},
|
||||
{
|
||||
displayName: 'HTML Formatting',
|
||||
@@ -264,28 +236,31 @@ export class Pushover implements INodeType {
|
||||
loadOptionsMethod: 'getSounds',
|
||||
},
|
||||
default: '',
|
||||
description: 'The name of one of the sounds supported by device clients to override the user\'s default sound choice. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
description:
|
||||
'The name of one of the sounds supported by device clients to override the user\'s default sound choice. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Timestamp',
|
||||
name: 'timestamp',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'A Unix timestamp of your message\'s date and time to display to the user, rather than the time your message is received by our API',
|
||||
description:
|
||||
"A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API",
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Your message\'s title, otherwise your app\'s name is used',
|
||||
description: "Your message's title, otherwise your app's name is used",
|
||||
},
|
||||
{
|
||||
displayName: 'Timestamp',
|
||||
name: 'timestamp',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'A Unix timestamp of your message\'s date and time to display to the user, rather than the time your message is received by our API',
|
||||
description:
|
||||
"A Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API",
|
||||
},
|
||||
{
|
||||
displayName: 'URL',
|
||||
@@ -361,14 +336,16 @@ export class Pushover implements INodeType {
|
||||
Object.assign(body, additionalFields);
|
||||
|
||||
if (body.attachmentsUi) {
|
||||
const attachment = (body.attachmentsUi as IDataObject).attachmentsValues as IDataObject;
|
||||
const attachment = (body.attachmentsUi as IDataObject)
|
||||
.attachmentsValues as IDataObject;
|
||||
|
||||
if (attachment) {
|
||||
|
||||
const binaryPropertyName = attachment.binaryPropertyName as string;
|
||||
|
||||
if (items[i].binary === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i });
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
|
||||
const item = items[i].binary as IBinaryKeyData;
|
||||
@@ -376,7 +353,11 @@ export class Pushover implements INodeType {
|
||||
const binaryData = item[binaryPropertyName] as IBinaryData;
|
||||
|
||||
if (binaryData === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`, { itemIndex: i });
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`No binary data property "${binaryPropertyName}" does not exists on item!`,
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
|
||||
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
||||
@@ -392,12 +373,7 @@ export class Pushover implements INodeType {
|
||||
}
|
||||
}
|
||||
|
||||
responseData = await pushoverApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
`/messages.json`,
|
||||
body,
|
||||
);
|
||||
responseData = await pushoverApiRequest.call(this, 'POST', `/messages.json`, body);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user