🎉 node-setup

This commit is contained in:
Ricardo Espinoza 2019-11-22 12:38:08 -05:00
parent 6a96349ed6
commit 52acbe390a
4 changed files with 67 additions and 2 deletions

View file

@ -0,0 +1,24 @@
import {
ICredentialType,
NodePropertyTypes,
} from 'n8n-workflow';
export class PaypalApi implements ICredentialType {
name = 'paypalApi';
displayName = 'Paypal API';
properties = [
{
displayName: 'Client ID',
name: 'clientId',
type: 'string' as NodePropertyTypes,
default: '',
},
{
displayName: 'Secret',
name: 'secret',
type: 'string' as NodePropertyTypes,
default: '',
},
];
}

View file

@ -0,0 +1,39 @@
import {
IExecuteFunctions,
} from 'n8n-core';
import {
IDataObject,
INodeTypeDescription,
INodeExecutionData,
INodeType,
} from 'n8n-workflow';
export class Paypal implements INodeType {
description: INodeTypeDescription = {
displayName: 'Paypal',
name: 'Paypal',
icon: 'file:paypal.png',
group: ['output'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Paypal API',
defaults: {
name: 'Paypal',
color: '#356ae6',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'paypalApi',
required: true,
}
],
properties: [],
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
return [this.helpers.returnJsonArray({})];
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -49,7 +49,8 @@
"dist/credentials/NextCloudApi.credentials.js",
"dist/credentials/OpenWeatherMapApi.credentials.js",
"dist/credentials/PipedriveApi.credentials.js",
"dist/credentials/Postgres.credentials.js",
"dist/credentials/Postgres.credentials.js",
"dist/credentials/Paypal.credentials.js",
"dist/credentials/Redis.credentials.js",
"dist/credentials/RocketchatApi.credentials.js",
"dist/credentials/SlackApi.credentials.js",
@ -108,7 +109,8 @@
"dist/nodes/OpenWeatherMap.node.js",
"dist/nodes/Pipedrive/Pipedrive.node.js",
"dist/nodes/Pipedrive/PipedriveTrigger.node.js",
"dist/nodes/Postgres/Postgres.node.js",
"dist/nodes/Postgres/Postgres.node.js",
"dist/nodes/Paypal/Paypal.node.js",
"dist/nodes/Rocketchat/Rocketchat.node.js",
"dist/nodes/ReadBinaryFile.node.js",
"dist/nodes/ReadBinaryFiles.node.js",