UNPKG

n8n-nodes-community-coolify

Version:

n8n node to interact with Coolify API - an open-source & self-hostable Heroku / Netlify alternative

783 lines 24.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.coolifyFields = exports.coolifyOperations = exports.deploymentOperations = exports.databaseOperations = exports.serviceOperations = exports.applicationOperations = exports.projectOperations = exports.serverOperations = void 0; exports.serverOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['server'], }, }, options: [ { name: 'Get Server Domains', value: 'getDomains', description: 'Get domains configured for a server', action: 'Get server domains', routing: { request: { method: 'GET', url: '=/api/v1/servers/{{$parameter.serverUuid}}/domains', }, }, }, { name: 'Get Server Metrics', value: 'getMetrics', description: 'Get CPU and memory usage of a server', action: 'Get server metrics', routing: { request: { method: 'GET', url: '=/api/v1/servers/{{$parameter.serverUuid}}/metrics', }, }, }, { name: 'Get Server Resources', value: 'getResources', description: 'Get resources running on a server', action: 'Get server resources', routing: { request: { method: 'GET', url: '=/api/v1/servers/{{$parameter.serverUuid}}/resources', }, }, }, { name: 'Get Server Status', value: 'getStatus', description: 'Get status of a specific server', action: 'Get server status', routing: { request: { method: 'GET', url: '=/api/v1/servers/{{$parameter.serverUuid}}/status', }, }, }, { name: 'List All Servers', value: 'list', description: 'Get all Coolify servers', action: 'List all servers', routing: { request: { method: 'GET', url: '/api/v1/servers', }, }, }, { name: 'Validate Server Connection', value: 'validateConnection', description: 'Validate connection to a server', action: 'Validate server connection', routing: { request: { method: 'POST', url: '=/api/v1/servers/{{$parameter.serverUuid}}/validate', }, }, }, ], default: 'list', }, ]; exports.projectOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['project'], }, }, options: [ { name: 'Create Project', value: 'create', description: 'Create a new project', action: 'Create a new project', routing: { request: { method: 'POST', url: '/api/v1/projects', }, }, }, { name: 'Delete Project', value: 'delete', description: 'Delete a project', action: 'Delete project', routing: { request: { method: 'DELETE', url: '=/api/v1/projects/{{$parameter.projectUuid}}', }, }, }, { name: 'Get Environment Variables', value: 'getEnvironmentVariables', description: 'Get variables in an environment', action: 'Get environment variables', routing: { request: { method: 'GET', url: '=/api/v1/projects/{{$parameter.projectUuid}}/environments/{{$parameter.environment}}/variables', }, }, }, { name: 'Get Project Details', value: 'get', description: 'Get details of a specific project', action: 'Get project details', routing: { request: { method: 'GET', url: '=/api/v1/projects/{{$parameter.projectUuid}}', }, }, }, { name: 'Get Project Environments', value: 'getEnvironments', description: 'Get environments in a project', action: 'Get project environments', routing: { request: { method: 'GET', url: '=/api/v1/projects/{{$parameter.projectUuid}}/environments', }, }, }, { name: 'List All Projects', value: 'list', description: 'Get all Coolify projects', action: 'List all projects', routing: { request: { method: 'GET', url: '/api/v1/projects', }, }, }, { name: 'Update Project', value: 'update', description: 'Update project details', action: 'Update project', routing: { request: { method: 'PUT', url: '=/api/v1/projects/{{$parameter.projectUuid}}', }, }, }, ], default: 'list', }, ]; exports.applicationOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['application'], }, }, options: [ { name: 'List All Applications', value: 'list', description: 'Get all applications', action: 'List all applications', routing: { request: { method: 'GET', url: '/api/v1/applications', }, }, }, { name: 'Create Application', value: 'create', description: 'Create a new application', action: 'Create a new application', routing: { request: { method: 'POST', url: '/api/v1/applications', }, }, }, { name: 'Get Application Details', value: 'get', description: 'Get details of a specific application', action: 'Get application details', routing: { request: { method: 'GET', url: '=/api/v1/applications/{{$parameter.applicationUuid}}', }, }, }, { name: 'Delete Application', value: 'delete', description: 'Delete an application', action: 'Delete application', routing: { request: { method: 'DELETE', url: '=/api/v1/applications/{{$parameter.applicationUuid}}', }, }, }, ], default: 'list', }, ]; exports.serviceOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['service'], }, }, options: [ { name: 'List All Services', value: 'list', description: 'Get all running services', action: 'List all services', routing: { request: { method: 'GET', url: '/api/v1/services', }, }, }, { name: 'Create Service', value: 'create', description: 'Create a new service', action: 'Create a new service', routing: { request: { method: 'POST', url: '/api/v1/services', }, }, }, { name: 'Get Service Status', value: 'getStatus', description: 'Get status of a specific service', action: 'Get service status', routing: { request: { method: 'GET', url: '=/api/v1/services/{{$parameter.serviceUuid}}/status', }, }, }, { name: 'Delete Service', value: 'delete', description: 'Delete a service and clean up resources', action: 'Delete service', routing: { request: { method: 'DELETE', url: '=/api/v1/services/{{$parameter.serviceUuid}}', }, }, }, ], default: 'list', }, ]; exports.databaseOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['database'], }, }, options: [ { name: 'Create Database', value: 'create', description: 'Create a new database', action: 'Create a new database', routing: { request: { method: 'POST', url: '/api/v1/databases', }, }, }, { name: 'Delete Database', value: 'delete', description: 'Delete a database and clean up volumes', action: 'Delete database', routing: { request: { method: 'DELETE', url: '=/api/v1/databases/{{$parameter.databaseUuid}}', }, }, }, { name: 'Get Database Configuration', value: 'get', description: 'Get configuration of a specific database', action: 'Get database configuration', routing: { request: { method: 'GET', url: '=/api/v1/databases/{{$parameter.databaseUuid}}', }, }, }, { name: 'List All Databases', value: 'list', description: 'Get all databases', action: 'List all databases', routing: { request: { method: 'GET', url: '/api/v1/databases', }, }, }, { name: 'Update Database', value: 'update', description: 'Update database configuration', action: 'Update database', routing: { request: { method: 'PUT', url: '=/api/v1/databases/{{$parameter.databaseUuid}}', }, }, }, ], default: 'list', }, ]; exports.deploymentOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['deployment'], }, }, options: [ { name: 'Deploy Application', value: 'deploy', description: 'Deploy an application', action: 'Deploy application', routing: { request: { method: 'POST', url: '=/api/v1/applications/{{$parameter.applicationUuid}}/deploy', }, }, }, { name: 'Force Rebuild and Deploy', value: 'forceRebuild', description: 'Force rebuild and deploy an application', action: 'Force rebuild and deploy', routing: { request: { method: 'POST', url: '=/api/v1/applications/{{$parameter.applicationUuid}}/deploy?force=true', }, }, }, { name: 'Get Deployment Status', value: 'getStatus', description: 'Get status of a specific deployment', action: 'Get deployment status', routing: { request: { method: 'GET', url: '=/api/v1/deployments/{{$parameter.deploymentUuid}}', }, }, }, { name: 'List All Deployments', value: 'list', description: 'Get all active deployments', action: 'List all deployments', routing: { request: { method: 'GET', url: '/api/v1/deployments', }, }, }, { name: 'List Recent Deployments', value: 'listRecent', description: 'List recent deployments for an application', action: 'List recent deployments', routing: { request: { method: 'GET', url: '=/api/v1/applications/{{$parameter.applicationUuid}}/deployments', }, }, }, ], default: 'list', }, ]; exports.coolifyOperations = [ ...exports.serverOperations, ...exports.projectOperations, ...exports.applicationOperations, ...exports.serviceOperations, ...exports.databaseOperations, ...exports.deploymentOperations, ]; const serverFields = [ { displayName: 'Server UUID', name: 'serverUuid', type: 'string', default: '', required: true, description: 'The UUID of the server', displayOptions: { show: { resource: ['server'], operation: ['getStatus', 'getResources', 'getDomains', 'validateConnection', 'getMetrics'], }, }, }, ]; const projectFields = [ { displayName: 'Project UUID', name: 'projectUuid', type: 'string', default: '', required: true, description: 'The UUID of the project', displayOptions: { show: { resource: ['project'], operation: ['get', 'update', 'delete', 'getEnvironments', 'getEnvironmentVariables'], }, }, }, { displayName: 'Project Name', name: 'projectName', type: 'string', default: '', required: true, description: 'The name of the project', displayOptions: { show: { resource: ['project'], operation: ['create'], }, }, }, { displayName: 'Project Description', name: 'projectDescription', type: 'string', default: '', description: 'The description of the project', displayOptions: { show: { resource: ['project'], operation: ['create'], }, }, }, { displayName: 'Environment', name: 'environment', type: 'options', options: [ { name: 'Production', value: 'production' }, { name: 'Staging', value: 'staging' }, { name: 'Development', value: 'development' }, ], default: 'production', required: true, description: 'The environment to get variables for', displayOptions: { show: { resource: ['project'], operation: ['getEnvironmentVariables'], }, }, }, ]; const applicationFields = [ { displayName: 'Application UUID', name: 'applicationUuid', type: 'string', default: '', required: true, description: 'The UUID of the application', displayOptions: { show: { resource: ['application'], operation: ['get', 'delete'], }, }, }, { displayName: 'Application Name', name: 'applicationName', type: 'string', default: '', required: true, description: 'The name of the application', displayOptions: { show: { resource: ['application'], operation: ['create'], }, }, }, ]; const serviceFields = [ { displayName: 'Service UUID', name: 'serviceUuid', type: 'string', default: '', required: true, description: 'The UUID of the service', displayOptions: { show: { resource: ['service'], operation: ['getStatus', 'delete'], }, }, }, { displayName: 'Service Name', name: 'serviceName', type: 'string', default: '', required: true, description: 'The name of the service', displayOptions: { show: { resource: ['service'], operation: ['create'], }, }, }, { displayName: 'Service Type', name: 'serviceType', type: 'options', options: [ { name: 'MongoDB', value: 'mongodb' }, { name: 'MySQL', value: 'mysql' }, { name: 'PostgreSQL', value: 'postgresql' }, { name: 'Redis', value: 'redis' }, { name: 'WordPress with MySQL', value: 'wordpress-with-mysql' }, ], default: 'wordpress-with-mysql', required: true, description: 'The type of service to create', displayOptions: { show: { resource: ['service'], operation: ['create'], }, }, }, { displayName: 'Project UUID', name: 'serviceProjectUuid', type: 'string', default: '', required: true, description: 'The UUID of the project for the service', displayOptions: { show: { resource: ['service'], operation: ['create'], }, }, }, { displayName: 'Server UUID', name: 'serviceServerUuid', type: 'string', default: '', required: true, description: 'The UUID of the server for the service', displayOptions: { show: { resource: ['service'], operation: ['create'], }, }, }, ]; const databaseFields = [ { displayName: 'Database UUID', name: 'databaseUuid', type: 'string', default: '', required: true, description: 'The UUID of the database', displayOptions: { show: { resource: ['database'], operation: ['get', 'update', 'delete'], }, }, }, { displayName: 'Database Type', name: 'databaseType', type: 'options', options: [ { name: 'MongoDB', value: 'mongodb' }, { name: 'MySQL', value: 'mysql' }, { name: 'PostgreSQL', value: 'postgresql' }, { name: 'Redis', value: 'redis' }, ], default: 'postgresql', required: true, description: 'The type of database to create', displayOptions: { show: { resource: ['database'], operation: ['create'], }, }, }, { displayName: 'Memory Limit (MB)', name: 'memoryLimit', type: 'number', default: 512, description: 'Memory limit in MB', displayOptions: { show: { resource: ['database'], operation: ['create', 'update'], }, }, }, { displayName: 'Public Port', name: 'publicPort', type: 'number', default: 5432, description: 'Public port for the database', displayOptions: { show: { resource: ['database'], operation: ['create', 'update'], }, }, }, { displayName: 'Password', name: 'password', type: 'string', default: '', typeOptions: { password: true, }, description: 'Password for the database', displayOptions: { show: { resource: ['database'], operation: ['create', 'update'], }, }, }, ]; const deploymentFields = [ { displayName: 'Deployment UUID', name: 'deploymentUuid', type: 'string', default: '', required: true, description: 'The UUID of the deployment', displayOptions: { show: { resource: ['deployment'], operation: ['getStatus'], }, }, }, { displayName: 'Application UUID', name: 'deploymentApplicationUuid', type: 'string', default: '', required: true, description: 'The UUID of the application to deploy', displayOptions: { show: { resource: ['deployment'], operation: ['deploy', 'forceRebuild', 'listRecent'], }, }, }, ]; exports.coolifyFields = [ ...serverFields, ...projectFields, ...applicationFields, ...serviceFields, ...databaseFields, ...deploymentFields, ]; //# sourceMappingURL=CoolifyDescription.js.map