n8n-nodes-xcredentialsx
Version:
Enhanced n8n nodes for credentials management and improved node execution with dropdown selection
44 lines (43 loc) • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.N8nApi = void 0;
class N8nApi {
constructor() {
this.name = 'n8nApi';
this.displayName = 'n8n API';
this.documentationUrl = 'https://docs.n8n.io/api/';
this.properties = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
default: '',
description: 'The API key for n8n instance',
},
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: 'http://localhost:5678',
description: 'The base URL of your n8n instance',
},
];
this.authenticate = {
type: 'generic',
properties: {
headers: {
'X-N8N-API-KEY': '={{$credentials.apiKey}}',
},
},
};
this.test = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/rest/login',
method: 'GET',
},
};
}
}
exports.N8nApi = N8nApi;