n8n-nodes-neuronwriter
Version:
n8n community node for NeuronWriter API integration - SEO content analysis and optimization
62 lines (61 loc) • 2.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NeuronWriterApi = void 0;
class NeuronWriterApi {
constructor() {
this.name = 'neuronWriterApi';
this.displayName = 'NeuronWriter API';
this.documentationUrl = 'https://help.neuronwriter.com/en/articles/6896915-neuronwriter-api-how-to-use';
this.properties = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: {
password: true
},
default: '',
required: true,
description: 'Your NeuronWriter API key (starts with "n-"). You can find it in your NeuronWriter profile under "Neuron API access" tab.',
placeholder: 'n-abc123...',
},
{
displayName: 'API Endpoint',
name: 'apiEndpoint',
type: 'string',
default: 'https://app.neuronwriter.com/neuron-api/0.5/writer',
required: true,
description: 'NeuronWriter API endpoint URL. Use the default unless you have a custom setup.',
},
];
this.authenticate = {
type: 'generic',
properties: {
headers: {
'X-API-KEY': '={{$credentials.apiKey}}',
'Accept': 'application/json',
'Content-Type': 'application/json',
},
},
};
this.test = {
request: {
baseURL: '={{$credentials.apiEndpoint}}',
url: '/list-projects',
method: 'POST',
body: {},
},
rules: [
{
type: 'responseSuccessBody',
properties: {
key: 'length',
value: 0,
message: 'No projects found, but API connection is working',
},
},
],
};
}
}
exports.NeuronWriterApi = NeuronWriterApi;