Commit Graph

11 Commits

Author SHA1 Message Date
Fourier f1d4d119c6 fix(client): replace go1.25 multipart.FileContentDisposition with compatible impl
multipart.FileContentDisposition was introduced in Go 1.25 but go.mod
targets 1.24, causing CI build failures. Replace with manual
Content-Disposition header construction with proper quote escaping.
2026-03-20 11:20:32 +08:00
Fourier 218de498fa refactor(client): use context.WithTimeout for upload instead of mutating httpClient
Replace the pattern of temporarily swapping httpClient.Timeout (not
concurrency-safe) with context.WithTimeout on the request. This is
the idiomatic Go approach and safe for concurrent use.
2026-03-20 09:04:57 +08:00
liu.zhen 5a0989489e fix(client): increase timeout for file upload requests
The default 30s HTTP client timeout is too short for file uploads,
causing "context deadline exceeded" errors. Use a dedicated 5-minute
timeout for the UploadFileContent method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 11:49:38 +08:00
chenyu 10c44cd967 fix(client): escape quoted multipart filenames 2026-03-10 18:27:11 -07:00
chenyu 50d29f8ebe fix(file): repair Notion file upload flow 2026-03-10 17:58:29 -07:00
Fourier 2bc33ce168 fix: lint gosimple S1009 — remove redundant nil checks on map 2026-02-24 16:21:33 +08:00
Fourier fe37d1f99b feat(auth): add multi-profile support with switch command
- Add profiles support to config structure
- Add auth switch command for interactive/direct profile switching
- Update auth login to support --profile flag
- Update auth status to show current profile
- Update getToken() to use profile system
- Backward compatible: auto-migrates legacy single-token config
- Add comprehensive tests for profile functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-24 15:29:00 +08:00
Fourier 4f7c2f7cdf fix: CI test failures + goreleaser deprecations
- config_test: use t.Setenv for reliable env isolation on CI
- config_test: skip permission test on Windows
- test.yml: align Go matrix with go.mod (1.24)
- goreleaser: fix deprecated formats/homebrew_casks fields
- block: improve --format md rendering with proper indentation
- block: add more markdown parse test cases
- page: minor improvements
2026-02-19 06:11:59 +08:00
Fourier 2fcf8b0f49 feat: complete all remaining features for 100% completeness
- Add --filter-json for raw Notion API filter JSON (OR/nested queries)
- Add --all pagination to db query (all list commands now support --all/--cursor)
- Add semantic error hints with actionable suggestions for 10 API error codes
- Add page create --db for database parent (schema-aware property detection)
- Add block list --depth N for recursive nested block fetching
- Add block list --md for Markdown output rendering
- Add Markdown-to-blocks parser for --file (h1-h3/bullet/numbered/todo/quote/code/divider)
- Add comment get command
- Move todo parsing before bullet to prevent --[ ] matching as bullet
- Add 24 new tests (block markdown parsing + error hints)

Total: 4,310 lines Go, 1,056 lines tests, 124 test cases, 9.6MB binary
2026-02-19 01:18:57 +08:00
Fourier 3304d8044e test: comprehensive test suite — 100 test cases
Coverage:
- cmd/db_test.go: filter parsing (12 cases), sort parsing (5),
  operator mapping (text/number/date), schema option extraction (4)
- cmd/page_test.go: block type mapping (18), property value building
  (15+3+1+1), property extraction (15), rich text extraction (3)
- internal/util/url_test.go: URL/ID resolution (7)
- internal/config/config_test.go: save/load, missing config, file permissions (3)
- internal/client/client_test.go: constructor, debug toggle, constants,
  no token in URL (4)

Security: verified no token/secret leakage in debug output,
config file permissions test ensures 0600.
2026-02-19 00:34:20 +08:00
Fourier c66e1d34bb v0.1.0: Full Notion CLI
30 commands covering the entire Notion API:
- auth: login, status, logout
- search: full-text search with type filter
- page: view, list, create, delete, move, open, set, props
- db: list, view, query (filter/sort), create, update, add, open
- block: list, get, append, update, delete
- comment: list, add
- user: me, list, get
- file: list, upload
- api: raw escape hatch for any endpoint

Features:
- Auto-detect TTY: pretty tables in terminal, JSON when piped
- Full Notion IDs in all output (no truncation)
- URL-to-ID resolution (accepts notion.so URLs everywhere)
- Filter syntax for db query: Status=Done, Date>=2026-01-01, Name~=keyword
- Sort syntax: Date:desc, Name:asc
- Property type auto-detection from schema
- Debug mode (--debug) for API troubleshooting
- Shell completion via cobra

3,239 lines of Go. Single binary. Zero dependencies at runtime.
2026-02-18 23:40:14 +08:00