n8n-nodes-gitlab-code-splitter

0.1.6 • Public • Published

n8n-nodes-gitlab-code-splitter

This is an n8n community node that provides integration with the GitLab Code Splitter API. It allows you to split GitLab repository code into manageable chunks for AI processing and analysis.

Features

  • System Operations: Health checks and supported language queries
  • Code Splitting: Split individual code content into manageable chunks
  • Repository Processing: Comprehensive GitLab repository code splitting with various filtering options
  • Architectural Layer Support: Split code by architectural layers (domain, application, adapters, ports, tests, command)
  • Custom Path Filtering: Include/exclude specific paths and file extensions
  • Secure Authentication: URL parameter validation and API key support

Installation

Follow the installation guide in the n8n community nodes documentation.

npm install n8n-nodes-gitlab-code-splitter

Configuration

Credentials

Set up your GitLab Code Splitter API credentials:

  1. API URL: The base URL of your GitLab Code Splitter API instance (default: http://localhost:3000)
  2. API Key (required): Authentication key sent in X-API-Key header for all API requests

Operations

System Operations

  • Health Check: Verify API availability
  • Get Languages: Retrieve supported programming languages

Code Operations

  • Split: Split individual code content with customizable options

Repository Operations

  • Split All Files: Process all repository files
  • Split by Layer: Process specific architectural layers
  • Split by Path: Process files in custom paths

Parameters

GitLab Configuration

  • GitLab URL: GitLab instance URL (validates URL format)
  • Project ID: GitLab project identifier (group/project format)
  • GitLab Token: Personal access token (validates token format: glpat-, gldt-, or gloas-)
  • Branch: Git branch to process

File Filtering

  • File Extensions: Specify file types to process
  • Include Paths: Directory paths to include
  • Exclude Paths: Directory paths to exclude (default: .git, vendor, node_modules)
  • Max File Size: Maximum file size limit in bytes

Split Options

  • Max Tokens: Maximum tokens per chunk
  • Overlap: Token overlap between chunks
  • Min Chunk Size: Minimum chunk size in tokens
  • Preserve Newlines: Whether to preserve newline characters

Usage Examples

Health Check

{
  "resource": "system",
  "operation": "healthCheck"
}

Split Domain Layer

{
  "resource": "repository",
  "operation": "splitByLayer",
  "layerType": "domain",
  "gitlabUrl": "https://gitlab.com",
  "projectId": "mygroup/myproject",
  "token": "glpat-xxxxxxxxxxxxxxxxxxxx",
  "branch": "main"
}

Split Custom Code

{
  "resource": "code",
  "operation": "split",
  "code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Hello, World!\")\n}",
  "language": "go",
  "filePath": "example.go"
}

Security Features

  • URL Validation: Ensures valid API URLs
  • Token Format Validation: Validates GitLab token formats
  • Enhanced API Key Validation: Comprehensive API key validation including:
    • Length constraints (10-200 characters)
    • Character validation (alphanumeric, hyphens, underscores only)
    • Placeholder/common invalid value detection
    • Required X-API-Key header for all requests
  • Secure Credential Storage: Uses n8n's secure credential system

Development

npm install
npm run build
npm run lint

License

MIT

Support

For issues and questions, please visit the GitHub repository.

Package Sidebar

Install

npm i n8n-nodes-gitlab-code-splitter

Weekly Downloads

205

Version

0.1.6

License

MIT

Unpacked Size

104 kB

Total Files

11

Last publish

Collaborators

  • stemx