♻️ Import HTTP Verbs operations and fields

This commit is contained in:
brianinoa 2022-06-16 12:00:05 +02:00
commit 5909f4d124

View file

@ -1,6 +1,6 @@
import { INodeType, INodeTypeDescription } from "n8n-workflow"; import { INodeType, INodeTypeDescription } from "n8n-workflow";
import { httpVerbOperations, httpVerbFields } from "./HttpVerbDescriptions";
// Description of our Node
export class HttpBin implements INodeType { export class HttpBin implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
displayName: "HttpBin", displayName: "HttpBin",
@ -23,7 +23,7 @@ export class HttpBin implements INodeType {
}, },
], ],
requestDefaults: { requestDefaults: {
baseURL: "={{$credentials.domain}}", baseURL: "https://httpbin.org",
url: "", url: "",
headers: { headers: {
Accept: "application/json", Accept: "application/json",
@ -44,7 +44,7 @@ export class HttpBin implements INodeType {
noDataExpression: true, noDataExpression: true,
options: [ options: [
{ {
name: "Http Verbs", name: "HTTP Verbs",
value: "httpverbs", value: "httpverbs",
}, },
{ {
@ -54,24 +54,8 @@ export class HttpBin implements INodeType {
], ],
default: "httpverbs", default: "httpverbs",
}, },
{ ...httpVerbOperations,
displayName: "Operation", ...httpVerbFields,
name: "operation",
type: "options",
noDataExpression: true,
displayOptions: {
show: {
resource: ["httpverbs"],
},
},
options: [
{
name: "GET",
value: "getMethod",
},
],
default: "getMethod",
},
], ],
}; };
} }