From 71978520bac111a56a54a591d16dacf7565fd2b1 Mon Sep 17 00:00:00 2001 From: brianinoa Date: Tue, 14 Jun 2022 17:02:04 +0200 Subject: [PATCH] :zap: Fix node name and color :zap: Add initial Resource and Operation --- nodes/HttpBin/HttpBin.node.ts | 53 +++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/nodes/HttpBin/HttpBin.node.ts b/nodes/HttpBin/HttpBin.node.ts index 161c44b..e4e7f6c 100644 --- a/nodes/HttpBin/HttpBin.node.ts +++ b/nodes/HttpBin/HttpBin.node.ts @@ -1,5 +1,6 @@ import { INodeType, INodeTypeDescription } from "n8n-workflow"; +// Description of our Node export class HttpBin implements INodeType { description: INodeTypeDescription = { displayName: "HttpBin", @@ -10,15 +11,15 @@ export class HttpBin implements INodeType { subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: "Interact with HttpBin API", defaults: { - name: "Sendinblue", - color: "#044a75", + name: "HttpBin", + color: "#3b4151", }, inputs: ["main"], outputs: ["main"], credentials: [ { - name: "sendinblueApi", - required: true, + name: "httpbinApi", + required: false, }, ], requestDefaults: { @@ -29,6 +30,48 @@ export class HttpBin implements INodeType { "Content-Type": "application/json", }, }, - properties: [], + /** + * In the properties array we have two mandatory options objects required + * + * Resource & Operation + * + */ + properties: [ + { + displayName: "Resource", + name: "resource", + type: "options", + noDataExpression: true, + options: [ + { + name: "Http Verbs", + value: "httpverbs", + }, + { + name: "Auth Methods", + value: "authmethods", + }, + ], + default: "httpverbs", + }, + { + displayName: "Operation", + name: "operation", + type: "options", + noDataExpression: true, + displayOptions: { + show: { + resource: ["httpverbs"], + }, + }, + options: [ + { + name: "GET", + value: "getMethod", + }, + ], + default: "getMethod", + }, + ], }; }