n8n-nodes-ionos
Version:
n8n nodes for IONOS DNS, Domain, SSL/Certificate management, Cloud AI, Cloud Infrastructure, Container Registry, Database as a Service, CDN, VPN Gateway, Activity Log, Billing, Logging, Monitoring, Object Storage Management, Network File Storage, Identity
87 lines (86 loc) • 2.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IonosApi = void 0;
class IonosApi {
name = 'ionosApi';
displayName = 'IONOS API';
documentationUrl = 'https://developer.hosting.ionos.com/docs/getstarted';
properties = [
{
displayName: 'Authentication Method',
name: 'authMethod',
type: 'options',
options: [
{
name: 'API Key',
value: 'apiKey',
},
{
name: 'API Prefix + Secret',
value: 'prefixSecret',
},
],
default: 'apiKey',
},
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
default: '',
displayOptions: {
show: {
authMethod: ['apiKey'],
},
},
description: 'The API key from your IONOS account',
},
{
displayName: 'API Prefix',
name: 'apiPrefix',
type: 'string',
default: '',
displayOptions: {
show: {
authMethod: ['prefixSecret'],
},
},
},
{
displayName: 'API Secret',
name: 'apiSecret',
type: 'string',
typeOptions: { password: true },
default: '',
displayOptions: {
show: {
authMethod: ['prefixSecret'],
},
},
},
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: 'https://api.hosting.ionos.com',
description: 'The base URL for the IONOS API',
},
];
authenticate = {
type: 'generic',
properties: {
headers: {
'X-API-Key': '={{$credentials.authMethod === "apiKey" ? $credentials.apiKey : ""}}',
Authorization: '={{$credentials.authMethod === "prefixSecret" ? "Basic " + Buffer.from($credentials.apiPrefix + "." + $credentials.apiSecret).toString("base64") : ""}}',
},
},
};
test = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/dns/v1/zones',
method: 'GET',
},
};
}
exports.IonosApi = IonosApi;