Commit Graph

33 Commits

Author SHA1 Message Date
6fcef454ee docs: Update CONTINUE.md with pending bug status
Document "Not found" bug still unresolved despite all verified fields:
- urlId, revisionCount, collaboratorIds, content, editorVersion all correct
- Need to check Outline server logs or compare with UI-created document

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:17:48 +00:00
1e462b5c49 fix: Add editorVersion field for document visibility
Documents without editorVersion='15.0.0' return "Not found" in Outline.
This was the missing field causing MCP-created documents to fail.

- Added editorVersion column to INSERT statement
- Set to '15.0.0' (current Outline editor version)
- v1.3.17

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:10:33 +00:00
d1561195bf feat: Add table support to Markdown-ProseMirror converter
- Tables now render properly in Outline Wiki
- Parses Markdown table syntax (| Col1 | Col2 |)
- Converts to ProseMirror table structure with tr, th, td nodes
- First row becomes header cells (th)
- Bidirectional: tables also convert back to Markdown
- v1.3.16

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:51:58 +00:00
f640465f86 fix: Use correct ProseMirror mark types (strong/em)
Outline schema uses:
- "strong" not "bold"
- "em" not "italic"

Error was: "RangeError: There is no mark type bold in this schema"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:23:27 +00:00
12d3b26454 feat: Add Markdown to ProseMirror converter
- New converter supports headings, lists, blockquotes, code blocks
- Documents now render with proper formatting in Outline
- Auto-update collection documentStructure on document creation
- Documents appear in sidebar automatically

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:15:10 +00:00
114895ff56 fix: Add revisionCount and content for document listing
Documents require:
- revisionCount >= 1 (was 0)
- content field with ProseMirror JSON structure

Without these, documents don't appear in collection sidebar.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:06:52 +00:00
b0ec9558f2 fix: Include creator in collaboratorIds for document listing
Documents with empty collaboratorIds don't appear in collection sidebar.
Now includes creator's userId in the array.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:05:12 +00:00
9598aba0bf fix: Add collaboratorIds field to document creation
Outline requires collaboratorIds to be an array, not NULL.
Error was: "TypeError: b.collaboratorIds is not iterable"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:43:16 +00:00
f1df797ac4 fix: Correct urlId format for documents (10 chars)
Outline uses 10-char alphanumeric urlId, not 21-char hex.
Documents with wrong format returned 404 "Not found".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:40:47 +00:00
12710c2b2f fix(critical): Create revision on document creation
Documents created via MCP were not visible in Outline interface.
Outline requires an entry in the revisions table to display documents.

Now uses transaction to insert into both documents and revisions tables.

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