Commit Graph

15 Commits

Author SHA1 Message Date
56f37892c0 fix: Schema compatibility - 8 column/table fixes found during testing
Fixed issues discovered during comprehensive testing of 164 tools:

- groups.ts: Remove non-existent description column
- analytics.ts: Use group_permissions instead of collection_group_memberships
- notifications.ts: Remove non-existent data column
- imports-tools.ts: Remove non-existent type/documentCount/fileCount columns
- emojis.ts: Graceful handling when emojis table doesn't exist
- teams.ts: Remove passkeysEnabled/description/preferences columns
- collections.ts: Use lastModifiedById instead of updatedById
- revisions.ts: Use lastModifiedById instead of updatedById

Tested 45+ tools against production (hub.descomplicar.pt)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:23:00 +00:00
7d2a014b74 fix: Schema compatibility - emoji → icon column rename
Production Outline DB uses 'icon' column instead of 'emoji' for documents
and revisions. Fixed all affected queries:

- documents.ts: SELECT queries
- advanced-search.ts: Search queries
- analytics.ts: Analytics + GROUP BY
- export-import.ts: Export/import metadata
- templates.ts: Template queries + INSERT
- collections.ts: Collection document listing
- revisions.ts: Revision comparison

reactions.emoji kept unchanged (correct schema)

Tested: 448 documents successfully queried from hub.descomplicar.pt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:14:27 +00:00
5f49cb63e8 feat: v1.3.1 - Multi-transport + Production deployment
- Add HTTP transport (StreamableHTTPServerTransport)
- Add shared server module (src/server/)
- Configure production for hub.descomplicar.pt
- Add SSH tunnel script (start-tunnel.sh)
- Fix connection leak in pg-client.ts
- Fix atomicity bug in comments deletion
- Update docs with test plan for 164 tools

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:06:30 +00:00
0329a1179a fix: corrigir bugs críticos de segurança e memory leaks (v1.2.4)
- fix(pagination): SQL injection em cursor pagination - validação de nomes de campos
- fix(transaction): substituir Math.random() por crypto.randomBytes() para jitter
- fix(monitoring): memory leak - adicionar .unref() ao setInterval
- docs: adicionar relatório completo de bugs (BUG-REPORT-2026-01-31.md)
- chore: actualizar versão para 1.2.4
2026-01-31 16:09:25 +00:00
22601e1680 fix: Security and code quality bug fixes
Security:
- Fix potential SQL injection in Savepoint class by sanitizing savepoint names
  - Only allow alphanumeric characters and underscores
  - Prefix with "sp_" if name starts with number
  - Limit to 63 characters (PostgreSQL identifier limit)

Code quality:
- Add missing radix parameter to parseInt calls in:
  - collections.ts (4 occurrences)
  - groups.ts (1 occurrence)
  - revisions.ts (1 occurrence)
  - users.ts (1 occurrence)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:36:07 +00:00
b4ba42cbf1 feat: Add production-ready utilities and performance improvements
Security & Data Integrity:
- Centralized transaction helper with deadlock retry (exponential backoff)
- SafeQueryBuilder for safe parameterized queries
- Zod-based input validation middleware
- Audit logging to Outline's events table

Performance:
- Cursor-based pagination for large datasets
- Pool monitoring with configurable alerts
- Database index migrations for optimal query performance

Changes:
- Refactored bulk-operations, desk-sync, export-import to use centralized transaction helper
- Added 7 new utility modules (audit, monitoring, pagination, query-builder, transaction, validation)
- Created migrations/001_indexes.sql with 40+ recommended indexes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:23:32 +00:00
7c83a9e168 fix(security): Resolve 21 SQL injection vulnerabilities and add transactions
Security fixes (v1.2.2):
- Fix SQL injection in analytics.ts (16 occurrences)
- Fix SQL injection in advanced-search.ts (1 occurrence)
- Fix SQL injection in search-queries.ts (1 occurrence)
- Add validateDaysInterval(), isValidISODate(), validatePeriod() to security.ts
- Use make_interval(days => N) for safe PostgreSQL intervals
- Validate UUIDs BEFORE string construction

Transaction support:
- bulk-operations.ts: 6 atomic operations with withTransaction()
- desk-sync.ts: 2 operations with transactions
- export-import.ts: 1 operation with transaction

Rate limiting:
- Add automatic cleanup of expired entries (every 5 minutes)

Audit:
- Archive previous audit docs to docs/audits/2026-01-31-v1.2.1/
- Create new AUDIT-REQUEST.md for v1.2.2 verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:47:41 +00:00
7895f31394 feat: Add export/import and Desk CRM sync tools (164 total)
New modules:
- export-import.ts (2 tools): export_collection_to_markdown, import_markdown_folder
- desk-sync.ts (2 tools): create_desk_project_doc, link_desk_task

Updated:
- CHANGELOG.md: Version 1.2.1
- CLAUDE.md: Updated to 164 tools across 33 modules
- CONTINUE.md: Updated state documentation
- AUDIT-REQUEST.md: Updated metrics and file list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:24:05 +00:00
83b70f557e feat: Add 52 new tools bringing total to 160
New modules (11):
- teams.ts (5 tools): Team/workspace management
- integrations.ts (6 tools): External integrations (Slack, embeds)
- notifications.ts (4 tools): User notification management
- subscriptions.ts (4 tools): Document subscription management
- templates.ts (5 tools): Document template management
- imports-tools.ts (4 tools): Import job management
- emojis.ts (3 tools): Custom emoji management
- user-permissions.ts (3 tools): Permission management
- bulk-operations.ts (6 tools): Batch operations
- advanced-search.ts (6 tools): Faceted search, recent, orphaned, duplicates
- analytics.ts (6 tools): Usage statistics and insights

Updated:
- src/index.ts: Import and register all new tools
- src/tools/index.ts: Export all new modules
- CHANGELOG.md: Version 1.2.0 entry
- CLAUDE.md: Updated tool count to 160
- CONTINUE.md: Updated state documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:53:27 +00:00
fa0e052620 feat: Add 22 new tools for complete Outline coverage (v1.1.0)
New modules (22 tools):
- Stars (3): list, create, delete - bookmarks
- Pins (3): list, create, delete - highlighted docs
- Views (2): list, create - view tracking
- Reactions (3): list, create, delete - emoji on comments
- API Keys (4): list, create, update, delete
- Webhooks (4): list, create, update, delete
- Backlinks (1): list - read-only view
- Search Queries (2): list, stats - analytics

Total tools: 86 -> 108 (+22)
All 22 new tools validated against Outline v0.78 schema.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:40:37 +00:00
9213970d44 docs: Update CHANGELOG with complete v1.0.1 fixes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:35:09 +00:00
7116722d73 fix: Complete schema adaptation for all tool modules
- auth.ts: Use suspendedAt instead of isSuspended, role instead of isAdmin
- comments.ts: Use role='admin' for admin user queries
- documents.ts: Use suspendedAt IS NULL for active users
- events.ts: Return actorRole instead of actorIsAdmin
- shares.ts: Use role='admin' for admin user queries

All queries validated against Outline v0.78 schema (10/10 tests pass).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:34:53 +00:00
6f5d17516b fix: Adapt SQL queries to actual Outline database schema
- Users: Use role enum instead of isAdmin/isViewer/isSuspended booleans
- Users: Remove non-existent username column
- Groups: Fix group_users table (no deletedAt, composite PK)
- Attachments: Remove url and deletedAt columns, use hard delete

All 10/10 core queries now pass validation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:32:41 +00:00
42fc0c6d6d docs: Add continuation prompt for future sessions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:25:59 +00:00
b05b54033f feat: Initial release MCP Outline PostgreSQL v1.0.0
86 tools across 12 modules for direct PostgreSQL access to Outline Wiki:
- Documents (19), Collections (14), Users (9), Groups (8)
- Comments (6), Shares (5), Revisions (3), Events (3)
- Attachments (5), File Operations (4), OAuth (8), Auth (2)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:25:09 +00:00