BREAKING:
- Binary renamed oo-cli → oo; install path is now
github.com/eslider/go-onlyoffice/cmd/oo.
- Former internal/cli tree removed; cobra commands live in cmd/oo/ as
package main, split by domain (calendar.go, crm.go, tasks.go, apps.go,
common.go, main.go).
- internal/applications moved to cmd/oo/applications/ (CV-specific workflow;
not a library feature).
- examples/applications removed (it depended on an internal package).
Library split (mechanical, zero API surface change):
- client.go — Client, Credentials, Defaults, env helpers, NewClient.
- request.go — Request, Query, Time, Token, MetaResponse, Permissions.
- auth.go — Authenticate/AuthenticateContext/InvalidateToken.
- http.go — transport + ResponseArray/ResponseObject/postFormObject/
putFormObject/deleteObject/unmarshalResponseObject (renamed
from httpx.go).
- projects.go, tasks.go, users.go, calendar.go, crm.go, files.go — typed
/ untyped domain methods. tasks_extra.go merged into tasks.go.
- onlyoffice.go deleted (content redistributed).
AGENTS.md, CHANGELOG.md, README.md updated accordingly.
Made-with: Cursor
7.0 KiB
7.0 KiB
Changelog
All notable changes to this project are documented here. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[0.4.0] - 2026-04-24
Changed — project structure
- Library files reorganised by domain (mechanical split; zero API surface
change). The former monolithic
onlyoffice.go(687 LOC) is now split into:client.go—Client,Credentials,Defaults, env helpers,NewClient.request.go—Request,Query,Time,Token,MetaResponse,Permissions,requestBodyReader.auth.go—Authenticate,AuthenticateContext,InvalidateToken,Auth,ensureToken,authHeader,tokenValid.http.go— transport helpers and DRY response decoders (ResponseArray,ResponseObject,postFormObject,putFormObject,deleteObject,unmarshalResponseObject).projects.go—Project,Projects,Milestone,ProjectOwner+GetProjects/CreateProject/UpdateProject/DeleteProject/GetProjectByID/GetProjectMilestones.tasks.go—Task,ProjectTaskStatus,TaskPriority,ProjectGetTasksRequestet al. plus the form-encoded helpers formerly intasks_extra.go(ListTasks,AddTask,AddSubtask,UpdateTaskStatus,DeleteTask,GetTaskByID).users.go—User,Contact,Group,GetUsers,SelfUserID.calendar.go,crm.go,files.go— unchanged in scope, refactored through the new DRY helpers.httpx.go→ renamedhttp.go.onlyoffice.goandtasks_extra.go— deleted (content redistributed).
Changed — CLI BREAKING
- Binary renamed
oo-cli→oo. Install withgo install github.com/eslider/go-onlyoffice/cmd/oo@latest. - Package path
cmd/oo-cli→cmd/oo. The old path is removed. internal/cliis gone. Cobra commands now live directly undercmd/oo/aspackage main, split by domain:calendar.go,crm.go,tasks.go,apps.go,common.go. Rationale: cobra wiring is a CLI-only concern and does not belong inside apkg-level internal/.internal/applications→cmd/oo/applications/. This is a CV-specific CRM workflow — not a general OnlyOffice feature — and is only consumed by theooCLI. Keeping it undercmd/oo/prevents accidental external adoption and makes the coupling explicit.examples/applications/removed. It imported an internal package, which was a policy smell. Remaining examples (basic,calendar,crm,subtasks) use only the exported library surface.
Added
(*Client).ResponseObject— GET-and-decode-object counterpart to the existingResponseArray.(*Client).postFormObject/putFormObject/deleteObject— eliminate the ~15 identical "form request →responseField→json.Unmarshal" blocks previously duplicated acrosscrm.go/tasks_extra.go/calendar.go/files.go.
Migration
External library consumers: no changes required. The module path
(github.com/eslider/go-onlyoffice), the onlyoffice package name, and
every exported symbol are unchanged.
CLI users: replace oo-cli with oo in scripts and CI. The command set
and flags are identical.
[0.3.2] - 2026-04-24
Fixed
Project.String()no longer interprets the title as a format string (fmt.Sprintf(*p.Title)) and is now nil-safe on a zero-valueProject.internal/applications.buildSummaryno longer panics at regex compile time on Go 1.23+ — the previous(?= ...)lookahead is replaced with an RE2-safe non-capturing trailing delimiter.
Changed
Client.Querynow routes token acquisition through the sharedensureTokenpath instead of duplicating the auth-expiry check inline.- Request body marshalling is consolidated into an unexported
requestBodyReaderhelper (DRY; no change to the public surface). - The
Request.Debugfield is preserved for backwards compatibility but no longer changes behaviour — both branches used to unmarshal into the same target value. We'll remove the field in a future major release.
Tests
- Deleted
httptest.NewServerfixtures that emulated OnlyOffice protocol endpoints. Replaced them with:- pure-Go unit tests in
unit_test.go(no network); - real integration tests in
client_test.goguarded by//go:build integration. Run withgo test -tags=integration ./.... Tests skip cleanly whenONLYOFFICE_URL/USER/PASS(or aliases) are absent.
- pure-Go unit tests in
- New policy documented in
AGENTS.mdand.cursor/rules/no-synthetic-mocks.mdc.
[0.3.1] - 2026-04-24
Added
AuthenticateContext(ctx)— context-aware auth that honours cancellation and deadlines. Preferred entry point for long-running syncs (cron, watchers).InvalidateToken()— clears the cached token to force re-auth on the next request. Use this to recover from a mid-sync 401 when the server has revoked the session while the localExpirestimestamp still looks fresh.
Notes
- Plain
Authenticate()is unchanged and remains a convenience wrapper aroundAuthenticateContext(context.Background()). - No breaking changes; a patch release.
[0.3.0] - 2026-04-24
Added
- Calendar helpers:
ListCalendars,ListEvents,AddEvent,DeleteEvent. - CRM helpers: contacts (
ListContacts,GetContact,FindCompany,FindPerson,CreateCompany,CreatePerson,AddContactInfo,DeleteContact), deals (ListOpportunities,GetOpportunity,CreateOpportunity,AddOpportunityMember,ListDealStages,DeleteOpportunity), cases (ListCases,CreateCase,AddCaseMember,DeleteCase), CRM tasks (ListCRMTasks,CreateCRMTask,DeleteCRMTask,ListTaskCategories), and history notes (AddHistoryNote). - Project task extras:
GetProjectByID,ListTasks,ListAllTasks,GetTaskByID,AddTask,AddSubtask,UpdateTaskStatus,DeleteTask. - File upload:
UploadOpportunityFile(multipart). SelfUserIDcached lookup ofpeople/@self.Defaultsstruct +SetDefaults+GetEnvironmentDefaultsfor optional calendar/project fallbacks.- Alias env vars accepted by
GetEnvironmentCredentials:ONLYOFFICE_HOST/ONLYOFFICE_NAME/ONLYOFFICE_PASSWORD. - Public
Authenticate()that primes the token eagerly. - Bundled CLI:
cmd/oo-cli(Cobra) with commandscal-list,cal-events,cal-add,cal-delete,task-list,task-add,subtask-add,task-update,crm-contacts,crm-add-contact,crm-deals,crm-add-deal,crm-cases,applications-sync. - httptest-based unit tests for form / multipart / CRM helpers.
Changed
- The
onlyoffice.Clientstruct gained unexported fields (defaults,selfID,noteCatID); the public API is unchanged and remains backwards compatible.
[0.2.0] - earlier
- Badges, docs expansion (Gitea sync use case, Gantt/PM workflows).
[0.1.0] - earlier
- Initial release: OnlyOffice Project Management API client.