# n8n-nodes-mevspace

n8n community node for the **Mevspace API** — manage dedicated servers, startup scripts, and OS templates.

Built following the [`n8n-node-builder.skill.md`](n8n-node-builder.skill.md) skill from the Swagger 1.2 specs:
[`dedicateds.json`](dedicateds.json), [`startup-scripts.json`](startup-scripts.json), [`templates.json`](templates.json).

## Resources & Operations

| Resource         | Operation   | Method | Endpoint                                      |
| ---------------- | ----------- | ------ | --------------------------------------------- |
| Dedicated Server | Get All     | GET    | `/dedicateds`                                 |
| Dedicated Server | Get Details | GET    | `/dedicateds/{hostname}`                      |
| Dedicated Server | Order KVM   | POST   | `/dedicateds/{hostname}/order-kvm`            |
| Dedicated Server | Reinstall   | POST   | `/dedicateds/{hostname}/reinstall`            |
| Dedicated Server | Restart     | POST   | `/dedicateds/{hostname}/restart`              |
| Dedicated Server | Start       | POST   | `/dedicateds/{hostname}/start`                |
| Dedicated Server | Stop        | POST   | `/dedicateds/{hostname}/stop`                 |
| Startup Script   | Get All     | GET    | `/startup-scripts`                            |
| Template         | Get All     | GET    | `/templates?type={dedicated\|vps\|vps_cloud}` |

## Authentication

The Mevspace API uses an **access token passed as a query-string parameter** (`?access-token=...`).
Create a **Mevspace API** credential in n8n and paste your token — it is injected automatically on every request.

## Build

```bash
npm install --ignore-scripts   # --ignore-scripts avoids the isolated-vm native build (not needed for type-checking)
npm run build                  # tsc + gulp (copies SVGs into dist/)
npm run lint
```

## Link into a local n8n

```bash
npm run build
npm link

# in your n8n custom folder
mkdir -p ~/.n8n/custom && cd ~/.n8n/custom
npm init -y
npm link n8n-nodes-mevspace

n8n start
```

Then in n8n: add a **Mevspace API** credential with your access token, drop a **Mevspace** node, pick a resource + operation, and run.

## Project layout

```
n8n-nodes-mevspace/
├── package.json
├── tsconfig.json
├── gulpfile.js
├── .eslintrc.js
├── credentials/MevspaceApi.credentials.ts
├── nodes/Mevspace/Mevspace.node.ts
├── nodes/Mevspace/mevspace.svg         (your icon.avif → PNG embedded)
└── dist/                                (generated)
```

## License

MIT
