Commit Graph

23 Commits

Author SHA1 Message Date
1cdeafebb6 fix: Add default sort value to create_collection
Collections without sort field cause frontend error:
"Cannot read properties of null (reading 'field')"

Now sets {"field": "index", "direction": "asc"} as default.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:36:58 +00:00
1c8f6cbab9 fix: Shorten tool name exceeding 64 char limit
- Renamed outline_bulk_remove_users_from_collection (41 chars)
  to outline_bulk_remove_collection_users (38 chars)
- With MCP prefix (24 chars), total was 65 > 64 limit
- Bumped version to 1.3.7
- Updated all version references in source files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:27:13 +00:00
d5b92399b9 docs: Add production CRUD validation to changelog
Tested full CRUD cycle via MCP in production:
- list_collections, create_document, update_document, delete_document
- All operations successful with SSH tunnel on port 5433

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:25:00 +00:00
55b6a4b94f docs: Validate all bug fixes and update testing status
- Verified all 6 schema bugs fixed in source code
- Confirmed unit tests passing (209/209)
- HTTP server initializes correctly with 164 tools
- Updated CONTINUE.md with validation results
- Ready for MCP tool testing when available

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:20:21 +00:00
84a298fddd docs: Update CONTINUE.md with v1.3.6 instructions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:15:44 +00:00
354e8ae21f fix: Schema bugs in create operations - id/urlId columns missing
Fixed 3 schema compatibility bugs found during Round 3 write testing:
- create_document: Added id, urlId, teamId, isWelcome, fullWidth, insightsEnabled
- create_collection: Added id, maintainerApprovalRequired
- shares_create: Added id, allowIndexing, showLastUpdated

All write operations now include required NOT NULL columns.
Bumped version to 1.3.6.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:08:52 +00:00
2808d4aec0 fix: 3 schema bugs + add comprehensive testing documentation
Bug Fixes:
- auth.ts: Remove non-existent ap.updatedAt column
- subscriptions.ts: Add LIMIT 25 to prevent 136KB+ responses
- collections.ts: Remove documentStructure from list (use get for full)

Documentation:
- TESTING-GUIDE.md: Complete 164-tool reference with test status
- CONTINUE.md: Updated with verification status and MCP loading issue
- CHANGELOG.md: Document fixes and Round 1-2 test results

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:53:44 +00:00
15c6c5a24f feat: Add comprehensive Jest test suite (209 tests)
- Add Jest configuration for TypeScript testing
- Add security utilities tests (44 tests)
- Add Zod validation tests (34 tests)
- Add cursor pagination tests (25 tests)
- Add query builder tests (38 tests)
- Add tools structure validation (68 tests)
- All 164 tools validated for correct structure
- Version bump to 1.3.4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 17:33:19 +00:00
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