mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Pushover Node): Add 'HTML Formatting' option and credential test (#3082)
* Add html additional field https://pushover.net/api#html * ⚡ replaced input type to boolean, added credential test * ⚡ credentials and linter fixes * ⚡ Improvements * ⚡ Fix description Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ export class Pushover implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Pushover',
|
||||
name: 'pushover',
|
||||
icon: 'file:pushover.png',
|
||||
icon: 'file:pushover.svg',
|
||||
group: ['input'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
@@ -43,6 +43,7 @@ export class Pushover implements INodeType {
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Message',
|
||||
@@ -50,12 +51,13 @@ export class Pushover implements INodeType {
|
||||
},
|
||||
],
|
||||
default: 'message',
|
||||
description: 'The resource to operate on.',
|
||||
description: 'The resource to operate on',
|
||||
},
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
@@ -70,7 +72,7 @@ export class Pushover implements INodeType {
|
||||
},
|
||||
],
|
||||
default: 'push',
|
||||
description: 'The resource to operate on.',
|
||||
description: 'The resource to operate on',
|
||||
},
|
||||
{
|
||||
displayName: 'User Key',
|
||||
@@ -149,7 +151,7 @@ export class Pushover implements INodeType {
|
||||
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)',
|
||||
displayName: 'Retry (Seconds)',
|
||||
name: 'retry',
|
||||
type: 'number',
|
||||
typeOptions: {
|
||||
@@ -173,7 +175,7 @@ export class Pushover implements INodeType {
|
||||
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)',
|
||||
displayName: 'Expire (Seconds)',
|
||||
name: 'expire',
|
||||
type: 'number',
|
||||
typeOptions: {
|
||||
@@ -247,6 +249,13 @@ export class Pushover implements INodeType {
|
||||
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)',
|
||||
},
|
||||
{
|
||||
displayName: 'HTML Formatting',
|
||||
name: 'html',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to enable messages formatting with HTML tags',
|
||||
},
|
||||
{
|
||||
displayName: 'Sound',
|
||||
name: 'sound',
|
||||
@@ -257,6 +266,13 @@ export class Pushover implements INodeType {
|
||||
default: '',
|
||||
description: 'The name of one of the sounds supported by device clients to override the user\'s default sound choice',
|
||||
},
|
||||
{
|
||||
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',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
@@ -276,7 +292,7 @@ export class Pushover implements INodeType {
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'a supplementary URL to show with your message',
|
||||
description: 'A supplementary URL to show with your message',
|
||||
},
|
||||
{
|
||||
displayName: 'URL Title',
|
||||
@@ -326,6 +342,10 @@ export class Pushover implements INodeType {
|
||||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
|
||||
if (additionalFields.html !== undefined) {
|
||||
additionalFields.html = additionalFields.html ? '1' : '';
|
||||
}
|
||||
|
||||
const body: IDataObject = {
|
||||
user: userKey,
|
||||
message,
|
||||
|
||||
Reference in New Issue
Block a user