mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-10-28 06:02:25 -05:00
⚡ Create New HttpBin Declarative Node
This commit is contained in:
parent
1bb7f88a6e
commit
380b617a5f
4 changed files with 112 additions and 0 deletions
39
nodes/HttpBin/HttpBin.credentials.ts
Normal file
39
nodes/HttpBin/HttpBin.credentials.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import {
|
||||
IAuthenticateHeaderAuth,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from "n8n-workflow";
|
||||
|
||||
export class HttpBinApi implements ICredentialType {
|
||||
name = "HttpBinApi";
|
||||
displayName = "HttpBin API";
|
||||
documentationUrl = "httpbin";
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: "API Key",
|
||||
name: "apiKey",
|
||||
type: "string",
|
||||
default: "",
|
||||
},
|
||||
{
|
||||
displayName: "Domain",
|
||||
name: "domain",
|
||||
type: "string",
|
||||
default: "https://httpbin.org",
|
||||
},
|
||||
];
|
||||
authenticate = {
|
||||
type: "headerAuth",
|
||||
properties: {
|
||||
name: "api-key",
|
||||
value: "={{$credentials.apiKey}}",
|
||||
},
|
||||
} as IAuthenticateHeaderAuth;
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: "={{$credentials?.domain}}/v3",
|
||||
url: "/account",
|
||||
},
|
||||
};
|
||||
}
|
||||
21
nodes/HttpBin/HttpBin.node.json
Normal file
21
nodes/HttpBin/HttpBin.node.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"node": "n8n-nodes-base.httpbin",
|
||||
"nodeVersion": "1.0",
|
||||
"codexVersion": "1.0",
|
||||
"categories": [
|
||||
"HTTP Request & Response Service",
|
||||
"Developer Tools"
|
||||
],
|
||||
"resources": {
|
||||
"credentialDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/credentials/httpbin"
|
||||
}
|
||||
],
|
||||
"primaryDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/nodes/n8n-nodes-base.httpbin/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
34
nodes/HttpBin/HttpBin.node.ts
Normal file
34
nodes/HttpBin/HttpBin.node.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { INodeType, INodeTypeDescription } from "n8n-workflow";
|
||||
|
||||
export class HttpBin implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: "HttpBin",
|
||||
name: "httpbin",
|
||||
icon: "file:httpbin.svg",
|
||||
group: ["transform"],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: "Interact with HttpBin API",
|
||||
defaults: {
|
||||
name: "Sendinblue",
|
||||
color: "#044a75",
|
||||
},
|
||||
inputs: ["main"],
|
||||
outputs: ["main"],
|
||||
credentials: [
|
||||
{
|
||||
name: "sendinblueApi",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
requestDefaults: {
|
||||
baseURL: "={{$credentials.domain}}",
|
||||
url: "",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
},
|
||||
properties: [],
|
||||
};
|
||||
}
|
||||
18
nodes/HttpBin/httpbin.svg
Normal file
18
nodes/HttpBin/httpbin.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve"> <image id="image0" width="32" height="32" x="0" y="0"
|
||||
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAALGPC/xhBQAAACBjSFJN
|
||||
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElN
|
||||
RQfmBg4UAC/TqOZZAAACA0lEQVRIx5XVv09TURwF8M+jFHDSyRkGFhPAEfyRdDHi5uriXyDoYgKT
|
||||
MJDWzUT/Ahf/AiOEpajEgCESmpiYmDCxGowDTYE+h76+vte+15Zzk753b7733HNO772PbEw7ECba
|
||||
genswtEcgl0/PHARV72066YrIDSZ6k8KBym4741r0XsB284TdUX8chn1zrzwJUmw4KFXPqjFE0Y0
|
||||
u5YKEhpmfLZuy7f2wLKGI8WhDRYdaVhurdTCidmU5P44N+skaaGQH1IfFFrOYMotT932zNgQExve
|
||||
OfTeT8dtBceO3TFlOyopY7UPxV+/fWyn3Y0xrFhJjZWFXhs12pKdRO9ObGSuyB8Xbd9JjMjDc6HQ
|
||||
IcrKqAiVe8vyCEJPrGBWxZYqqtZt9RbmHabAvAAVdVUlJTvWshbMt0AYn40OmlchSKOePTyYIMQn
|
||||
rb8yI8TsDCrRs4od7Jv3KOoPGWKboBqp2LN3FQvdO7EPshSsRSTXrSop2cSiiUGkG/bj2JqaQiHW
|
||||
4nv50mFcu28j30KQarAnEPhuzvwwGYQ975vx7+JwGXTjTIAzoYlhCArR5d0KkfauqJAVY6+FG5hD
|
||||
OS6veqyCuSiTAQT/jKmlQtyxIBCoZV28HQvN6LuQvJFC4xjvibfYOZUdUXd9taTWJbOubiIVXmjG
|
||||
W/fs9qpZcpr6pOe1U0udSf8BR7ef4yxyOskAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDYtMTRU
|
||||
MTc6MDA6NDcrMDM6MDBfo1sRAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA2LTE0VDE3OjAwOjQ3
|
||||
KzAzOjAwLv7jrQAAAABJRU5ErkJggg==" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
Loading…
Add table
Add a link
Reference in a new issue