⚡ 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", | ||||
| 		}, | ||||
| 	}; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue