feat: merge oo-cli and extend library with Calendar/CRM/subtasks/files

- Add Calendar helpers (ListCalendars/ListEvents/AddEvent/DeleteEvent)
- Add CRM helpers: contacts, opportunities, cases, CRM tasks, history notes
- Add project-task extras (ListTasks/ListAllTasks/GetTaskByID/AddTask/
  AddSubtask/UpdateTaskStatus/DeleteTask, GetProjectByID)
- Add UploadOpportunityFile (multipart) and SelfUserID caching
- Introduce Defaults struct, SetDefaults, GetEnvironmentDefaults;
  GetEnvironmentCredentials now accepts ONLYOFFICE_HOST/NAME/PASSWORD aliases
- Add public Authenticate() helper that eagerly primes the token
- Bundle Cobra CLI at cmd/oo-cli with full command surface
  (calendar, tasks, subtasks, CRM, applications-sync); CLI-only deps
  (cobra, godotenv) kept out of the library surface
- Add httptest-based unit tests for form/multipart helpers
- Docs: CHANGELOG, AGENTS, .env.example, README updates for v0.3 features

Consolidates the standalone eSlider/oo-cli tool into this canonical Go
module (see eSlider/inventar ASR-0008).

Made-with: Cursor
This commit is contained in:
2026-04-24 11:30:11 +01:00
parent 6e27251824
commit 43e385ce9d
19 changed files with 2475 additions and 10 deletions
+22
View File
@@ -0,0 +1,22 @@
package applications
import "testing"
func TestExtractField(t *testing.T) {
text := "**Position**: Senior Dev\n**Company**: Acme\n"
if g := extract(text, `(?i)\*\*Position\*\*:\s*(.+?)(?:\s{2,}|\n)`); g != "Senior Dev" {
t.Fatalf("position: %q", g)
}
if g := extract(text, `(?i)\*\*Company\*\*:\s*(.+?)(?:\s{2,}|\n)`); g != "Acme" {
t.Fatalf("company: %q", g)
}
}
func TestParseSalary(t *testing.T) {
if v := parseSalary("€50,000"); v < 40000 {
t.Fatalf("annual: %v", v)
}
if v := parseSalary("400 / day"); v != 400*220 {
t.Fatalf("daily: %v", v)
}
}