Minor improvements to MessageBird-Node

This commit is contained in:
Jan Oberhauser 2020-06-12 09:39:56 +02:00
parent edd4c7a82f
commit 09862d602e
2 changed files with 27 additions and 27 deletions

View file

@ -1,15 +1,15 @@
import {
OptionsWithUri,
} from 'request';
import { import {
IExecuteFunctions, IExecuteFunctions,
IHookFunctions, IHookFunctions,
} from 'n8n-core'; } from 'n8n-core';
import {
OptionsWithUri,
} from 'request';
import { import {
IDataObject, IDataObject,
} from 'n8n-workflow'; } from 'n8n-workflow';
/** /**
* Make an API request to Message Bird * Make an API request to Message Bird
@ -26,7 +26,7 @@ export async function messageBirdApiRequest(
resource: string, resource: string,
body: IDataObject, body: IDataObject,
query: IDataObject = {}, query: IDataObject = {},
): Promise<any> { ): Promise<any> { // tslint:disable-line:no-any
const credentials = this.getCredentials('messageBirdApi'); const credentials = this.getCredentials('messageBirdApi');
if (credentials === undefined) { if (credentials === undefined) {
throw new Error('No credentials returned!'); throw new Error('No credentials returned!');
@ -41,7 +41,7 @@ export async function messageBirdApiRequest(
qs: query, qs: query,
body, body,
uri: `https://rest.messagebird.com${resource}`, uri: `https://rest.messagebird.com${resource}`,
json: true json: true,
}; };
try { try {

View file

@ -64,11 +64,11 @@ export class MessageBird implements INodeType {
{ {
name: 'Send', name: 'Send',
value: 'send', value: 'send',
description: 'Send text messages (SMS)' description: 'Send text messages (SMS)',
}, },
], ],
default: 'send', default: 'send',
description: 'The operation to perform.' description: 'The operation to perform.',
}, },
// ---------------------------------- // ----------------------------------
@ -91,7 +91,7 @@ export class MessageBird implements INodeType {
], ],
}, },
}, },
description: 'The number from which to send the message' description: 'The number from which to send the message.',
}, },
{ {
displayName: 'To', displayName: 'To',
@ -103,10 +103,10 @@ export class MessageBird implements INodeType {
displayOptions: { displayOptions: {
show: { show: {
operation: ['send'], operation: ['send'],
resource: ['sms'] resource: ['sms'],
} },
}, },
description: 'all recipients separated by commas' description: 'All recipients separated by commas.',
}, },
{ {
@ -125,7 +125,7 @@ export class MessageBird implements INodeType {
], ],
}, },
}, },
description: 'The message to be send' description: 'The message to be send.',
}, },
{ {
displayName: 'Additional Fields', displayName: 'Additional Fields',
@ -160,7 +160,7 @@ export class MessageBird implements INodeType {
}, },
], ],
default: '', default: '',
description: 'Using unicode will limit the maximum number of characters to 70 instead of 160', description: 'Using unicode will limit the maximum number of characters to 70 instead of 160.',
}, },
{ {
displayName: 'Gateway', displayName: 'Gateway',
@ -175,7 +175,7 @@ export class MessageBird implements INodeType {
placeholder: '1,2', placeholder: '1,2',
type: 'string', type: 'string',
default: '', default: '',
description: 'Group IDs separated by commas, If provided recipients can be omitted', description: 'Group IDs separated by commas, If provided recipients can be omitted.',
}, },
{ {
displayName: 'Message Type', displayName: 'Message Type',
@ -183,14 +183,14 @@ export class MessageBird implements INodeType {
type: 'options', type: 'options',
placeholder: 'Permissible values from 0-3', placeholder: 'Permissible values from 0-3',
options: [ options: [
{
name: 'Normal',
value: 0
},
{ {
name: 'Flash', name: 'Flash',
value: 1, value: 1,
}, },
{
name: 'Normal',
value: 0,
},
], ],
default: 1, default: 1,
description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.', description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.',
@ -221,10 +221,6 @@ export class MessageBird implements INodeType {
name: 'type', name: 'type',
type: 'options', type: 'options',
options: [ options: [
{
name: 'SMS',
value: 'sms'
},
{ {
name: 'Binary', name: 'Binary',
value: 'binary' value: 'binary'
@ -232,10 +228,14 @@ export class MessageBird implements INodeType {
{ {
name: 'Flash', name: 'Flash',
value: 'flash' value: 'flash'
} },
{
name: 'SMS',
value: 'sms'
},
], ],
default: '', default: '',
description: 'The type of message.<br /> Values can be: sms, binary, or flash.' description: 'The type of message.<br /> Values can be: sms, binary, or flash.',
}, },
{ {
displayName: 'Type Details', displayName: 'Type Details',