diff --git a/.env.example b/.env.example index 1bfdd8b..1bcd618 100644 --- a/.env.example +++ b/.env.example @@ -3,15 +3,25 @@ # This is an example of the environment variables needed for the application. # ServiceNow API Configuration -SERVICENOW_URL=https://your-instance.service-now.com/api/now/table/ -SERVICENOW_USERNAME=your_servicenow_username -SERVICENOW_PASSWORD=your_servicenow_password +SERVICENOW_INCIDENT_URL=https://caoadev.service-now.com/api/now/table/incident?sysparm_display_value=all&sysparm_limit=20&sysparm_query=ORDERBYDESCsys_created_on&sysparm_fields=number%2Copened_by%2Copened_at%2Clocation%2Cshort_description%2Cdescription%2Cvariables.caller_id%2Cvariables.location%2Cvariables.telephone_favorecido_rh%2Cvariables.numero_ramal%2Copened_by.email%2Csys_id%5Eassignment_group%3D46d44f91c611227500713c12f0b7c78d +SERVICENOW_USERNAME=SOTHIS.CAOA +SERVICENOW_PASSWORD=#Sothis20 # GLPI API Configuration GLPI_URL=https://your-glpi-instance/apirest.php/ GLPI_APP_TOKEN=your_glpi_app_token GLPI_USER_TOKEN=your_glpi_user_token +# GLPI access via DB (use DB connection instead of API) +GLPI_DB_TYPE=mysql # ou postgresql +GLPI_DB_HOST=localhost +GLPI_DB_PORT=3306 +GLPI_DB_USER=glpi_user +GLPI_DB_PASSWORD=your_glpi_db_password +GLPI_DB_NAME=glpi_database +GLPI_DB_CHARSET=utf8mb4 +GLPI_TABLE_PREFIX=glpi_ # deixe em branco se não houver prefixo + # Database Configuration DB_HOST=localhost DB_PORT=3306 # or 5432 for PostgreSQL diff --git a/config/apiConfig.js b/config/apiConfig.js new file mode 100644 index 0000000..fe666e4 --- /dev/null +++ b/config/apiConfig.js @@ -0,0 +1,17 @@ +const glpiDbConfig = { + client: process.env.GLPI_DB_TYPE || 'mysql', + connection: { + host: process.env.GLPI_DB_HOST || 'localhost', + port: process.env.GLPI_DB_PORT ? Number(process.env.GLPI_DB_PORT) : 3306, + user: process.env.GLPI_DB_USER || 'glpi_user', + password: process.env.GLPI_DB_PASSWORD || '', + database: process.env.GLPI_DB_NAME || 'glpi_database', + charset: process.env.GLPI_DB_CHARSET || 'utf8mb4' + }, + tablePrefix: process.env.GLPI_TABLE_PREFIX || '' +}; + +module.exports = { + // configuração do ServiceNow e outras já existentes podem permanecer + glpiDbConfig +}; \ No newline at end of file