UNPKG

n8n-nodes-anywebsites

Version:
74 lines (73 loc) 2.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AnyWebsitesApi = void 0; class AnyWebsitesApi { constructor() { this.name = 'anyWebsitesApi'; this.displayName = 'AnyWebsites API'; this.documentationUrl = 'https://anywebsites.com/docs'; this.properties = [ { displayName: 'Base URL', name: 'baseUrl', type: 'string', default: 'https://localhost:8443', placeholder: 'https://your-anywebsites-instance.com', description: 'The base URL of your AnyWebsites instance', required: true, }, { displayName: 'Username', name: 'username', type: 'string', default: '', placeholder: 'your_username', description: 'Your AnyWebsites username', required: true, }, { displayName: 'Password', name: 'password', type: 'string', typeOptions: { password: true, }, default: '', placeholder: 'your_password', description: 'Your AnyWebsites password', required: true, }, { displayName: 'Ignore SSL Issues', name: 'allowUnauthorizedCerts', type: 'boolean', default: true, description: 'Whether to ignore SSL certificate errors. Enable this for self-signed certificates or development environments.', }, ]; // No authentication here - will be handled in GenericFunctions // Test the credentials by attempting login this.test = { request: { baseURL: '={{$credentials.baseUrl}}', url: '/api/auth/login', method: 'POST', body: { username: '={{$credentials.username}}', password: '={{$credentials.password}}', }, skipSslCertificateValidation: '={{$credentials.allowUnauthorizedCerts}}', }, rules: [ { type: 'responseCode', properties: { value: 200, message: 'Login successful', }, }, ], }; } } exports.AnyWebsitesApi = AnyWebsitesApi;