diff --git a/README.md b/README.md index 944a14ab..18ea0388 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,43 @@ Calendar sync with Google and Microsoft (OAuth) or any ICS feed. Time tracking w ## Integrations +### Vikunja Sync + +Sync tasks bidirectionally with a [Vikunja](https://vikunja.io/) instance. Changes in TaskNotes push to Vikunja, and changes in Vikunja pull back to TaskNotes. + +**Setup:** +1. Go to **Settings → TaskNotes → Integrations** +2. Find the **Vikunja Task Sync** card +3. Enter your **API URL** (e.g., `https://vikunja.example.com/api/v1`) +4. Enter your **API Token** (get it from Vikunja Settings → API Tokens) +5. Enter the **Default List ID** (found in the URL when viewing a project: `/projects/123/list`) +6. Click **Test Connection** to verify +7. Toggle **Enable Vikunja Sync** + +**Sync options:** +- **Sync on create/update/complete**: Push changes when tasks are created, modified, or completed +- **Two-way sync**: Pull changes from Vikunja on a configurable interval +- **Sync Now**: Manually trigger a sync from the settings + +**Field mapping:** +| TaskNotes | Vikunja | +|-----------|---------| +| title | title | +| status (done/open) | done | +| due | due_date | +| scheduled | start_date | +| priority | priority | +| tags | labels | +| recurrence | repeat_after | +| reminders | reminders | +| projects | parent task (via relations) | +| body content | description (HTML) | + +### Other Integrations + TaskNotes has an optional HTTP API. There's a [browser extension](https://github.com/callumalpass/tasknotes-browser-extension) and a [CLI](https://github.com/callumalpass/tasknotes-cli). Webhooks can notify external services on task changes. See [HTTP API docs](./docs/HTTP_API.md) and [Webhooks docs](./docs/webhooks.md). + ## Language support UI: English, German, Spanish, French, Japanese, Russian, Chinese. diff --git a/package-lock.json b/package-lock.json index 19ae3e7d..4cb9a340 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tasknotes", - "version": "4.1.3", + "version": "4.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tasknotes", - "version": "4.1.3", + "version": "4.3.0", "license": "MIT", "dependencies": { "@codemirror/view": "^6.37.2", @@ -16,12 +16,16 @@ "@fullcalendar/list": "^6.1.17", "@fullcalendar/multimonth": "^6.1.17", "@fullcalendar/timegrid": "^6.1.17", + "@types/showdown": "^2.0.6", + "@types/turndown": "^5.0.6", "chrono-node": "^2.7.5", "date-fns": "^4.1.0", "ical.js": "^2.2.1", "obsidian-daily-notes-interface": "^0.9.4", "reflect-metadata": "^0.2.2", "rrule": "^2.8.1", + "showdown": "^2.1.0", + "turndown": "^7.2.2", "yaml": "^2.3.1" }, "devDependencies": { @@ -2405,6 +2409,12 @@ "ret": "~0.1.10" } }, + "node_modules/@mixmark-io/domino": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@mixmark-io/domino/-/domino-2.2.0.tgz", + "integrity": "sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==", + "license": "BSD-2-Clause" + }, "node_modules/@napi-rs/canvas": { "version": "0.1.78", "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.78.tgz", @@ -3713,6 +3723,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/showdown": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/showdown/-/showdown-2.0.6.tgz", + "integrity": "sha512-pTvD/0CIeqe4x23+YJWlX2gArHa8G0J0Oh6GKaVXV7TAeickpkkZiNOgFcFcmLQ5lB/K0qBJL1FtRYltBfbGCQ==", + "license": "MIT" + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -3744,10 +3760,9 @@ "license": "MIT" }, "node_modules/@types/turndown": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@types/turndown/-/turndown-5.0.5.tgz", - "integrity": "sha512-TL2IgGgc7B5j78rIccBtlYAnkuv8nUQqhQc+DSYV5j9Be9XOcm/SKOVRuA47xAVI3680Tk9B1d8flK2GWT2+4w==", - "dev": true, + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@types/turndown/-/turndown-5.0.6.tgz", + "integrity": "sha512-ru00MoyeeouE5BX4gRL+6m/BsDfbRayOskWqUvh7CLGW+UXxHQItqALa38kKnOiZPqJrtzJUgAC2+F0rL1S4Pg==", "license": "MIT" }, "node_modules/@types/yaml": { @@ -10720,6 +10735,13 @@ "@types/tern": "*" } }, + "node_modules/obsidian-typings/node_modules/@types/turndown": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@types/turndown/-/turndown-5.0.5.tgz", + "integrity": "sha512-TL2IgGgc7B5j78rIccBtlYAnkuv8nUQqhQc+DSYV5j9Be9XOcm/SKOVRuA47xAVI3680Tk9B1d8flK2GWT2+4w==", + "dev": true, + "license": "MIT" + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -11981,6 +12003,31 @@ "node": ">=8" } }, + "node_modules/showdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/showdown/-/showdown-2.1.0.tgz", + "integrity": "sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==", + "license": "MIT", + "dependencies": { + "commander": "^9.0.0" + }, + "bin": { + "showdown": "bin/showdown.js" + }, + "funding": { + "type": "individual", + "url": "https://www.paypal.me/tiviesantos" + } + }, + "node_modules/showdown/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", @@ -12685,6 +12732,15 @@ "node": "*" } }, + "node_modules/turndown": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/turndown/-/turndown-7.2.2.tgz", + "integrity": "sha512-1F7db8BiExOKxjSMU2b7if62D/XOyQyZbPKq/nUwopfgnHlqXHqQ0lvfUTeUIr1lZJzOPFn43dODyMSIfvWRKQ==", + "license": "MIT", + "dependencies": { + "@mixmark-io/domino": "^2.2.0" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 9afff8b3..c2852273 100644 --- a/package.json +++ b/package.json @@ -74,12 +74,16 @@ "@fullcalendar/list": "^6.1.17", "@fullcalendar/multimonth": "^6.1.17", "@fullcalendar/timegrid": "^6.1.17", + "@types/showdown": "^2.0.6", + "@types/turndown": "^5.0.6", "chrono-node": "^2.7.5", "date-fns": "^4.1.0", "ical.js": "^2.2.1", "obsidian-daily-notes-interface": "^0.9.4", "reflect-metadata": "^0.2.2", "rrule": "^2.8.1", + "showdown": "^2.1.0", + "turndown": "^7.2.2", "yaml": "^2.3.1" } } diff --git a/src/main.ts b/src/main.ts index 57ff575e..50546a39 100644 --- a/src/main.ts +++ b/src/main.ts @@ -97,6 +97,8 @@ import { MicrosoftCalendarService } from "./services/MicrosoftCalendarService"; import { LicenseService } from "./services/LicenseService"; import { CalendarProviderRegistry } from "./services/CalendarProvider"; import { TaskCalendarSyncService } from "./services/TaskCalendarSyncService"; +import { VikunjaService } from "./services/VikunjaService"; +import { VikunjaSyncService } from "./services/VikunjaSyncService"; interface TranslatedCommandDefinition { id: string; @@ -218,6 +220,10 @@ export default class TaskNotesPlugin extends Plugin { // Task-to-Google Calendar sync service taskCalendarSyncService: TaskCalendarSyncService; + // Vikunja Integration + vikunjaService: VikunjaService; + vikunjaSyncService: VikunjaSyncService; + // Bases filter converter for exporting saved views basesFilterConverter: import("./services/BasesFilterConverter").BasesFilterConverter; @@ -624,6 +630,24 @@ export default class TaskNotesPlugin extends Plugin { this.googleCalendarService ); + // Initialize Vikunja services + this.vikunjaService = new VikunjaService(this, this.settings.vikunja); + this.vikunjaSyncService = new VikunjaSyncService(this, this.vikunjaService); + this.vikunjaSyncService.initialize(); + + // Add Vikunja Sync Command + this.addCommand({ + id: "vikunja-sync-now", + name: "Vikunja: Sync Now", + callback: async () => { + if (this.vikunjaSyncService) { + new Notice("Vikunja sync started."); + await this.vikunjaSyncService.syncFromVikunja(); + new Notice("Vikunja sync completed."); + } + }, + }); + // Microsoft Calendar this.microsoftCalendarService.on("data-changed", () => { // Trigger calendar view refreshes when Microsoft Calendar events change @@ -1324,7 +1348,7 @@ export default class TaskNotesPlugin extends Plugin { const hasNewCalendarSettings = Object.keys(DEFAULT_SETTINGS.calendarViewSettings).some( (key) => !loadedData?.calendarViewSettings?.[ - key as keyof typeof DEFAULT_SETTINGS.calendarViewSettings + key as keyof typeof DEFAULT_SETTINGS.calendarViewSettings ] ); const hasNewCommandMappings = Object.keys(DEFAULT_SETTINGS.commandFileMapping).some( @@ -2993,7 +3017,7 @@ export default class TaskNotesPlugin extends Plugin { current.disableNoteIndexing !== this.previousCacheSettings.disableNoteIndexing || current.storeTitleInFilename !== this.previousCacheSettings.storeTitleInFilename || JSON.stringify(current.fieldMapping) !== - JSON.stringify(this.previousCacheSettings.fieldMapping) + JSON.stringify(this.previousCacheSettings.fieldMapping) ); } diff --git a/src/services/VikunjaService.ts b/src/services/VikunjaService.ts new file mode 100644 index 00000000..8e5b22b8 --- /dev/null +++ b/src/services/VikunjaService.ts @@ -0,0 +1,145 @@ + +import { requestUrl, RequestUrlParam } from "obsidian"; +import TaskNotesPlugin from "../main"; +import { VikunjaSettings } from "../types/settings"; + +export class VikunjaService { + plugin: TaskNotesPlugin; + settings: VikunjaSettings; + + constructor(plugin: TaskNotesPlugin, settings: VikunjaSettings) { + this.plugin = plugin; + this.settings = settings; + } + + private getHeaders() { + return { + "Authorization": `Bearer ${this.settings.apiToken}`, + "Content-Type": "application/json", + }; + } + + private async request(endpoint: string, method: string = "GET", body?: any): Promise { + let url = this.settings.apiUrl; + if (url.endsWith("/")) url = url.slice(0, -1); + if (!endpoint.startsWith("/")) endpoint = "/" + endpoint; + + const params: RequestUrlParam = { + url: url + endpoint, + method: method, + headers: this.getHeaders(), + }; + + if (body) { + params.body = JSON.stringify(body); + } + + try { + const response = await requestUrl(params); + if (response.status >= 200 && response.status < 300) { + return response.json; + } else { + console.error("Vikunja API Error:", response); + throw new Error(`Vikunja API Error: ${response.status}`); + } + } catch (error) { + console.error("Vikunja Request Failed:", error); + throw error; + } + } + + async validateConnection(): Promise { + try { + // Try to fetch user info or projects to validate token + await this.request("user"); + return true; + } catch (error) { + return false; + } + } + + async createTask(listId: number, task: any): Promise { + return this.request(`projects/${listId}/tasks`, "PUT", task); + } + + async updateTask(taskId: number, task: any): Promise { + return this.request(`tasks/${taskId}`, "POST", task); + } + + async deleteTask(taskId: number): Promise { + return this.request(`tasks/${taskId}`, "DELETE"); + } + + async getTask(taskId: number): Promise { + return this.request(`tasks/${taskId}`); + } + + /** + * Get tasks from a specific list/project. + * Use options for filtering/sorting if supported. + * Vikunja API supports 'filter_by', 'filter_value', 'sort_by', 'order_by'. + */ + async getTasks(listId: number, options: { + sort_by?: string[]; + order_by?: string[]; + filter_by?: string[]; + filter_value?: string[]; + page?: number; + } = {}): Promise { + const queryParams = new URLSearchParams(); + + if (options.sort_by) { + options.sort_by.forEach(val => queryParams.append("sort_by[]", val)); + } + if (options.order_by) { + options.order_by.forEach(val => queryParams.append("order_by[]", val)); + } + if (options.filter_by) { + options.filter_by.forEach(val => queryParams.append("filter_by[]", val)); + } + if (options.filter_value) { + options.filter_value.forEach(val => queryParams.append("filter_value[]", val)); + } + if (options.page) { + queryParams.append("page", options.page.toString()); + } + + const queryString = queryParams.toString(); + const endpoint = `projects/${listId}/tasks${queryString ? '?' + queryString : ''}`; + + return this.request(endpoint); + } + + async getLabels(page: number = 1, perPage: number = 50): Promise { + return this.request(`labels?page=${page}&per_page=${perPage}`); + } + + async createLabel(label: { title: string; description?: string; color?: string }): Promise { + return this.request("labels", "PUT", label); + } + + async updateTaskLabels(taskId: number, labels: any[]): Promise { + // labels array should contain label objects (with id) + return this.request(`tasks/${taskId}/labels/bulk`, "POST", { labels }); + } + + /** + * Create a relation between two tasks. + * @param taskId The base task ID + * @param otherTaskId The related task ID + * @param relationKind The kind of relation (e.g., "subtask", "parenttask", "related", "blocked", "blocking") + */ + async createTaskRelation(taskId: number, otherTaskId: number, relationKind: string): Promise { + return this.request(`tasks/${taskId}/relations`, "PUT", { + other_task_id: otherTaskId, + relation_kind: relationKind + }); + } + + /** + * Delete a relation between two tasks. + */ + async deleteTaskRelation(taskId: number, relationKind: string, otherTaskId: number): Promise { + return this.request(`tasks/${taskId}/relations/${relationKind}/${otherTaskId}`, "DELETE"); + } +} diff --git a/src/services/VikunjaSyncService.ts b/src/services/VikunjaSyncService.ts new file mode 100644 index 00000000..c647846e --- /dev/null +++ b/src/services/VikunjaSyncService.ts @@ -0,0 +1,766 @@ + +import { TFile, Notice } from "obsidian"; +import { format, parseISO, addSeconds } from "date-fns"; +import TaskNotesPlugin from "../main"; +import { VikunjaService } from "./VikunjaService"; +import { TaskInfo, EVENT_TASK_UPDATED, Reminder } from "../types"; +import TurndownService from "turndown"; +import showdown from "showdown"; +import { parseLinkToPath } from "../utils/linkUtils"; + +export class VikunjaSyncService { + plugin: TaskNotesPlugin; + vikunjaService: VikunjaService; + private syncIntervalId: number | null = null; + private isSyncing = false; + private turndownService: TurndownService; + private showdownConverter: showdown.Converter; + private isInternalUpdate = false; + private debouncedPush = new Map(); + + constructor(plugin: TaskNotesPlugin, vikunjaService: VikunjaService) { + this.plugin = plugin; + this.vikunjaService = vikunjaService; + this.turndownService = new TurndownService({ + headingStyle: "atx", + hr: "---", + bulletListMarker: "-", + codeBlockStyle: "fenced", + }); + this.showdownConverter = new showdown.Converter(); + this.turndownService.addRule('github-task-list', { + filter: 'li', + replacement: function (content, node) { + const item = node as HTMLLIElement; + if (item.classList.contains('task-list-item') || (item.querySelector('input[type="checkbox"]'))) { + const checkbox = item.querySelector('input[type="checkbox"]') as HTMLInputElement; + const checked = checkbox && checkbox.checked ? 'x' : ' '; + return '- [' + checked + '] ' + content + '\n'; + } + return '- ' + content + '\n'; + } + }); + } + + // --- Helpers --- + + private toVikunjaDate(dateStr?: string): string | null { + if (!dateStr) return null; + try { + // Tasknotes stores YYYY-MM-DD. Vikunja needs ISO with time. + const date = parseISO(dateStr); + // Set to noon or specific time? Vikunja might accept date-only or 00:00. + // Using T12:00:00 to avoid timezone shifts making it previous day. + return format(date, "yyyy-MM-dd'T'12:00:00xxx"); + } catch (e) { + console.error("Vikunja Sync: Date parse error", e); + return null; + } + } + + private fromVikunjaDate(isoStr?: string): string | undefined { + if (!isoStr) return undefined; + // Vikunja might return "0001-01-01T00:00:00Z" for empty dates + if (isoStr.startsWith("0001-") || isoStr.startsWith("0000-")) return undefined; + try { + return format(parseISO(isoStr), "yyyy-MM-dd"); + } catch (e) { + return undefined; + } + } + + private toVikunjaPriority(priority?: string): number { + if (!priority) return 0; // Unset in Vikunja + switch (priority.toLowerCase()) { + case "low": return 1; + case "normal": return 2; + case "medium": return 2; // Alias for normal + case "high": return 4; + case "critical": return 5; + default: return 0; // Unset for unknown values + } + } + + private fromVikunjaPriority(priority?: number): string { + if (priority === undefined || priority === null || priority === 0) return ""; // Unset + if (priority <= 1) return "low"; + if (priority === 2) return "normal"; + if (priority >= 3) return "high"; // Map 3, 4, 5 to high for simplicity + return ""; + } + + private toVikunjaRecurrence(recurrence?: string): number | null { + if (!recurrence) return null; + // Simple mapping from RFC string to seconds + if (recurrence.includes("FREQ=DAILY")) return 86400; + if (recurrence.includes("FREQ=WEEKLY")) return 604800; + if (recurrence.includes("FREQ=MONTHLY")) return 2592000; // Approx 30 days + if (recurrence.includes("FREQ=YEARLY")) return 31536000; + return null; + } + + private fromVikunjaRecurrence(seconds?: number): string | undefined { + if (!seconds) return undefined; + if (seconds >= 86000 && seconds <= 90000) return "FREQ=DAILY"; + if (seconds >= 600000 && seconds <= 610000) return "FREQ=WEEKLY"; + if (seconds >= 2400000 && seconds <= 2700000) return "FREQ=MONTHLY"; + if (seconds >= 31000000) return "FREQ=YEARLY"; + return undefined; + } + + private toVikunjaDateTime(dateStr?: string): string | null { + if (!dateStr) return null; + try { + const date = parseISO(dateStr); + // Preserve time for reminders + return format(date, "yyyy-MM-dd'T'HH:mm:ssxxx"); + } catch (e) { + console.error("Vikunja Sync: Date parse error", e); + return null; + } + } + + + + + + // --- End Helpers --- + + initialize() { + // Register event listener for task updates (Push) + this.plugin.registerEvent( + this.plugin.emitter.on(EVENT_TASK_UPDATED, this.onTaskUpdated.bind(this)) + ); + + // Register vault modify listener for manual edits + this.plugin.registerEvent( + this.plugin.app.vault.on("modify", (file) => { + if (file instanceof TFile && file.extension === "md") { + this.handleFileModification(file); + } + }) + ); + + // Start polling if enabled + this.updateSyncInterval(); + } + + private handleFileModification(file: TFile) { + if (this.isInternalUpdate) return; + + // Debounce + if (this.debouncedPush.has(file.path)) { + window.clearTimeout(this.debouncedPush.get(file.path)); + } + + const timeoutId = window.setTimeout(async () => { + // Fetch fresh task info + // Construct a partial TaskInfo or trigger onTaskUpdated logic + // Since onTaskUpdated handles reading the file, we can just call it passing the path + // But onTaskUpdated expects {path, updatedTask} + // We can construct a minimal updatedTask to trigger the flow + + // We need to verify if it's a monitored task + const cache = this.plugin.app.metadataCache.getFileCache(file); + if (!cache?.frontmatter?.vikunja_id) return; + + // Mimic TaskInfo structure - we only really need path and status for current logic, + // but onTaskUpdated re-reads the file body anyway. + // We need 'status' to determine if we should sync based on settings (syncOnComplete). + // Let's rely on cache frontmatter for status. + const status = cache.frontmatter.status || "open"; + + const dummyTaskInfo: TaskInfo = { + path: file.path, + title: cache.frontmatter.title || file.basename, + status: status, + priority: cache.frontmatter.priority, + // Add other required fields + due: cache.frontmatter.due, + scheduled: cache.frontmatter.scheduled, + recurrence: cache.frontmatter.recurrence, + tags: cache.frontmatter.tags, + projects: cache.frontmatter.projects, + reminders: cache.frontmatter.reminders, + } as any; + + await this.onTaskUpdated({ path: file.path, updatedTask: dummyTaskInfo }); + + this.debouncedPush.delete(file.path); + }, 2000); // 2 second debounce for typing + + this.debouncedPush.set(file.path, timeoutId); + } + + updateSyncInterval() { + if (this.syncIntervalId) { + window.clearInterval(this.syncIntervalId); + this.syncIntervalId = null; + } + + if (this.plugin.settings.vikunja.enabled && this.plugin.settings.vikunja.enableTwoWaySync) { + const intervalMs = this.plugin.settings.vikunja.syncInterval * 60 * 1000; + this.syncIntervalId = window.setInterval(() => { + this.syncFromVikunja(); + }, intervalMs); + console.log(`Vikunja Sync: Polling started every ${this.plugin.settings.vikunja.syncInterval} minutes.`); + } + } + + private async onTaskUpdated(data: { path: string; updatedTask?: TaskInfo; originalTask?: TaskInfo }) { + if (!this.plugin.settings.vikunja.enabled) return; + + const { path, updatedTask } = data; + if (!updatedTask) return; // Task deleted, handle separately if needed + + // Check if we should sync this task + const file = this.plugin.app.vault.getAbstractFileByPath(path); + if (!(file instanceof TFile)) return; + + const cache = this.plugin.app.metadataCache.getFileCache(file); + const frontmatter = cache?.frontmatter; + + if (frontmatter?.vikunja_ignore) return; + + try { + // Read actual file body for description + const content = await this.plugin.app.vault.read(file); + const frontmatterRegex = /^---\n[\s\S]*?\n---\n/; + const body = content.replace(frontmatterRegex, "").trim(); + + // Update task info with actual body + updatedTask.details = body; + + const vikunjaId = frontmatter?.vikunja_id; + + if (vikunjaId) { + // Update existing task + const isCompleted = updatedTask.status === "done"; + const shouldSyncUpdate = this.plugin.settings.vikunja.syncOnTaskUpdate; + const shouldSyncComplete = this.plugin.settings.vikunja.syncOnTaskComplete && isCompleted; + + if (shouldSyncUpdate || shouldSyncComplete) { + await this.updateVikunjaTask(vikunjaId, updatedTask); + } + } else { + // Create new task + if (this.plugin.settings.vikunja.syncOnTaskCreate) { + await this.createVikunjaTask(updatedTask); + } + } + } catch (error) { + console.error(`Vikunja Sync Error for ${path}:`, error); + } + } + + private async createVikunjaTask(task: TaskInfo) { + if (!this.plugin.settings.vikunja.defaultListId) { + console.warn("Vikunja Sync: No default list ID set."); + return; + } + + const payload = this.mapTaskToPayload(task); + const response = await this.vikunjaService.createTask(this.plugin.settings.vikunja.defaultListId, payload); + + if (response && response.id) { + console.log(`Vikunja Sync: Created task ${response.id} for ${task.title}`); + await this.saveVikunjaId(task.path, response.id); + if (task.tags && task.tags.length > 0) { + await this.syncTagsToVikunja(response.id, task.tags); + } + // Sync parent relation + await this.syncParentRelation(response.id, task); + new Notice(`Task created in Vikunja: ${task.title}`); + } else { + console.warn("Vikunja Sync: Task creation response missing ID:", response); + } + } + + private async updateVikunjaTask(vikunjaId: number, task: TaskInfo) { + const payload = this.mapTaskToPayload(task); + await this.vikunjaService.updateTask(vikunjaId, payload); + if (task.tags) { + await this.syncTagsToVikunja(vikunjaId, task.tags); + } + // Sync parent relation + await this.syncParentRelation(vikunjaId, task); + } + + private mapTaskToPayload(task: TaskInfo): any { + const payload: any = { + title: task.title, + description: task.details ? this.showdownConverter.makeHtml(task.details) : "", + done: task.status === "done", + priority: this.toVikunjaPriority(task.priority), + }; + + const dueDate = this.toVikunjaDate(task.due); + if (dueDate) payload.due_date = dueDate; + + const startDate = this.toVikunjaDate(task.scheduled); + if (startDate) payload.start_date = startDate; + + const repeatAfter = this.toVikunjaRecurrence(task.recurrence); + if (repeatAfter) { + payload.repeat_after = repeatAfter; + payload.repeat_mode = 0; // 0 = Period (e.g. every 7 days from completion), 1 = Date (e.g. every Monday) - using Period for safety + } + + const reminders = this.toVikunjaReminders(task.reminders); + if (reminders) payload.reminders = reminders; + + // Parent/Subtask Sync is handled separately via relations API + + return payload; + } + + // Creates/updates parent relation in Vikunja for subtask sync + private async syncParentRelation(vikunjaId: number, task: TaskInfo) { + const parentVikunjaId = this.getParentVikunjaId(task); + if (parentVikunjaId) { + try { + // Create a "parenttask" relation: the parent is the parenttask OF this current task + await this.vikunjaService.createTaskRelation(vikunjaId, parentVikunjaId, "parenttask"); + console.log(`Vikunja Sync: Created parenttask relation: ${vikunjaId} -> parent ${parentVikunjaId}`); + } catch (error: any) { + // Ignore "already exists" errors + if (!error.message?.includes("exists")) { + console.error(`Vikunja Sync: Error creating parent relation for ${vikunjaId}`, error); + } + } + } + } + + private getParentVikunjaId(task: TaskInfo): number | null { + console.log(`Vikunja Sync: Checking parent for task '${task.title}'`); + // Check 'projects' field + if (task.projects && task.projects.length > 0) { + // Use first project that has a Vikunja ID + for (const projectLink of task.projects) { + // Resolve link + const linkPath = parseLinkToPath(projectLink); + // Resolve to file + const file = this.plugin.app.metadataCache.getFirstLinkpathDest(linkPath, task.path); + if (file) { + const cache = this.plugin.app.metadataCache.getFileCache(file); + if (cache?.frontmatter?.vikunja_id) { + return cache.frontmatter.vikunja_id; + } + } + } + } + return null; + } + + private async saveVikunjaId(path: string, id: number) { + const file = this.plugin.app.vault.getAbstractFileByPath(path); + if (file instanceof TFile) { + await this.plugin.app.fileManager.processFrontMatter(file, (frontmatter) => { + frontmatter["vikunja_id"] = id; + frontmatter["vikunja_last_sync"] = Date.now(); + }); + } + } + + async syncFromVikunja() { + if (this.isSyncing) return; + this.isSyncing = true; + console.log("Vikunja Sync: Starting pull..."); + + try { + // Basic implementation: fetch recent tasks + // In a real scenario, we'd use filter_by=updated and filter_value > lastSync + // For now, let's just fetch default list tasks to demonstrate structure + if (!this.plugin.settings.vikunja.defaultListId) return; + + const tasks = await this.vikunjaService.getTasks(this.plugin.settings.vikunja.defaultListId, { + sort_by: ["updated"], + order_by: ["desc"], + page: 1 + }); + + console.log(`Vikunja Sync: Fetched ${Array.isArray(tasks) ? tasks.length : 0} tasks.`); + + if (Array.isArray(tasks)) { + // PASS 1: Create/update all tasks WITHOUT parent relations + // This ensures all files exist before we try to link them + const tasksNeedingParentUpdate: any[] = []; + + for (const vTask of tasks) { + const needsParentUpdate = await this.processRemoteTask(vTask, false); + if (needsParentUpdate) { + tasksNeedingParentUpdate.push(vTask); + } + } + + // PASS 2: Update parent relations now that all files exist + for (const vTask of tasksNeedingParentUpdate) { + await this.updateParentRelationOnly(vTask); + } + } else { + console.warn("Vikunja Sync: getTasks returned non-array:", tasks); + } + + } catch (error) { + console.error("Vikunja Pull Error:", error); + } finally { + this.isSyncing = false; + } + } + + // Update just the projects field for a task that has a parent + private async updateParentRelationOnly(vTask: any) { + const localFile = await this.findTaskByVikunjaId(vTask.id); + if (!localFile) return; + + const projects = await this.fromVikunjaParent(vTask); + if (!projects || projects.length === 0) return; + + this.isInternalUpdate = true; + try { + await this.plugin.app.fileManager.processFrontMatter(localFile, (frontmatter) => { + if (JSON.stringify(frontmatter["projects"]) !== JSON.stringify(projects)) { + frontmatter["projects"] = projects; + console.log(`Vikunja Sync: Updated parent relation for ${localFile.path} -> ${projects}`); + } + }); + } finally { + setTimeout(() => { this.isInternalUpdate = false; }, 100); + } + } + + private async processRemoteTask(vTask: any, skipParentUpdate: boolean = false): Promise { + // 1. Find local task with this vikunja_id + const localTask = await this.findTaskByVikunjaId(vTask.id); + + // Check if this task has a parent + const hasParent = vTask?.related_tasks?.parenttask?.length > 0; + + if (localTask) { + // 2. Compare and update if remote is newer + // Simplification: Always update local from remote in this polling cycle + // In reality, check timestamps + await this.updateLocalTask(localTask, vTask, skipParentUpdate); + } else { + // 3. Create local task if configured to import + if (this.plugin.settings.vikunja.enableTwoWaySync) { + await this.createLocalTaskFromVikunja(vTask, skipParentUpdate); + } + } + + // Return true if this task has a parent and we skipped the update + return hasParent && skipParentUpdate; + } + + private async createLocalTaskFromVikunja(vTask: any, skipParentUpdate: boolean = false) { + try { + // Avoid loop: ignore if we just pushed this + // But we don't have a reliable way to know "we just pushed it" without complex state using current ID. + // For now, relies on vikunja_id check prevention. + + const taskData: any = { + title: vTask.title, + status: vTask.done ? "done" : "open", + details: vTask.description, + priority: this.fromVikunjaPriority(vTask.priority), + due: this.fromVikunjaDate(vTask.due_date), + scheduled: this.fromVikunjaDate(vTask.start_date), + recurrence: this.fromVikunjaRecurrence(vTask.repeat_after), + tags: this.fromVikunjaLabels(vTask.labels), + // Skip projects in first pass, will be updated in second pass + projects: skipParentUpdate ? undefined : await this.fromVikunjaParent(vTask), + customFrontmatter: { + vikunja_id: vTask.id, + vikunja_last_sync: Date.now() + } + }; + + await this.plugin.taskService.createTask(taskData); + console.log(`Vikunja Sync: Created local task for Vikunja ID ${vTask.id}`); + } catch (error) { + console.error(`Vikunja Sync: Failed to create local task for ${vTask.id}`, error); + } + } + + private async findTaskByVikunjaId(id: number): Promise { + // Inefficient search for now, would need an index map in production + const files = this.plugin.app.vault.getMarkdownFiles(); + for (const file of files) { + const cache = this.plugin.app.metadataCache.getFileCache(file); + if (cache?.frontmatter?.vikunja_id === id) { + return file; + } + } + return null; + } + + private async updateLocalTask(file: TFile, vTask: any, skipParentUpdate: boolean = false) { + this.isInternalUpdate = true; + try { + // Prepare projects (async) before modifying frontmatter - skip if in first pass + const newProjects = skipParentUpdate ? undefined : await this.fromVikunjaParent(vTask); + + await this.plugin.app.fileManager.processFrontMatter(file, (frontmatter) => { + // Only update if changes + if (frontmatter["title"] !== vTask.title) frontmatter["title"] = vTask.title; + // Update status + // Update status + const newStatus = vTask.done ? "done" : "open"; + if (frontmatter["status"] !== newStatus) frontmatter["status"] = newStatus; + + // Map other fields + const newPriority = this.fromVikunjaPriority(vTask.priority); + if (frontmatter["priority"] !== newPriority) frontmatter["priority"] = newPriority; + + const newDue = this.fromVikunjaDate(vTask.due_date); + if (frontmatter["due"] !== newDue) { + if (newDue) frontmatter["due"] = newDue; + else delete frontmatter["due"]; + } + + const newScheduled = this.fromVikunjaDate(vTask.start_date); + if (frontmatter["scheduled"] !== newScheduled) { + if (newScheduled) frontmatter["scheduled"] = newScheduled; + else delete frontmatter["scheduled"]; + } + + const newRecurrence = this.fromVikunjaRecurrence(vTask.repeat_after); + if (frontmatter["recurrence"] !== newRecurrence) { + if (newRecurrence) frontmatter["recurrence"] = newRecurrence; + else delete frontmatter["recurrence"]; + } + + // Tags sync + const newTags = this.fromVikunjaLabels(vTask.labels); + // Sort to ensure order doesn't cause false changes + const oldTags = frontmatter["tags"] ? [...frontmatter["tags"]].sort() : []; + const sortedNewTags = newTags ? [...newTags].sort() : []; + if (JSON.stringify(oldTags) !== JSON.stringify(sortedNewTags)) { + if (newTags && newTags.length > 0) frontmatter["tags"] = newTags; + else delete frontmatter["tags"]; + } + + // Projects (Parent) Sync + // const newProjects = await this.fromVikunjaParent(vTask.parent_task_id); // MOVED OUT + if (newProjects && newProjects.length > 0) { + // Check if changed + if (JSON.stringify(frontmatter["projects"]) !== JSON.stringify(newProjects)) { + frontmatter["projects"] = newProjects; + } + } else { + // Do not delete existing projects if Vikunja has no parent, + // to prevent overwriting local organization unless explicit. + } + + // Reminders sync + const newReminders = this.fromVikunjaReminders(vTask.reminders); + // Simple comparison using JSON stringify to avoid deep object checking complexity + if (JSON.stringify(frontmatter["reminders"]) !== JSON.stringify(newReminders)) { + console.log(`Vikunja Sync: Updating reminders for ${file.path}. Old: ${JSON.stringify(frontmatter["reminders"])}, New: ${JSON.stringify(newReminders)}`); + if (newReminders) frontmatter["reminders"] = newReminders; + else delete frontmatter["reminders"]; + } + + frontmatter["vikunja_last_sync"] = Date.now(); + }); + + // Update body (description) + if (vTask.description !== undefined) { + const markdownBody = this.turndownService.turndown(vTask.description); + await this.updateFileBody(file, markdownBody); + } + } finally { + this.isInternalUpdate = false; + } + } + + private async updateFileBody(file: TFile, newBody: string) { + try { + const content = await this.plugin.app.vault.read(file); + const frontmatterRegex = /^---\n[\s\S]*?\n---\n/; + const match = content.match(frontmatterRegex); + + const currentFrontmatter = match ? match[0] : ""; + const currentBody = match ? content.replace(frontmatterRegex, "") : content; + + // Normalize newlines / trim for comparison + if (currentBody.trim() !== newBody.trim()) { + console.log(`Vikunja Sync: Updating description/body for ${file.path}`); + const newContent = currentFrontmatter + newBody; + + this.isInternalUpdate = true; + await this.plugin.app.vault.modify(file, newContent); + // isInternalUpdate will be reset in updateLocalTask finally block if called from there. + // But updateFileBody is async and awaited. + // We should ensure it's handled here too just in case it's called independently. + // However, updateLocalTask wraps this. + // If called independently, we might need own try/finally but updateLocalTask has it. + } + } catch (e) { + console.error(`Vikunja Sync: Error updating file body for ${file.path}`, e); + } + } + + // --- Helpers for Duration --- + private durationToSeconds(isoDuration?: string): number | null { + if (!isoDuration) return null; + // Simple regex for PT#M / PT#H / PT#S - simplified coverage + const matches = isoDuration.match(/PT(\d+)([HMS])/); + if (!matches) return 0; // Default to 0 if 0M or similar + const val = parseInt(matches[1]); + const unit = matches[2]; + if (unit === 'H') return val * 3600; + if (unit === 'M') return val * 60; + if (unit === 'S') return val; + return 0; + } + + private secondsToDuration(seconds: number): string { + if (seconds === 0) return "PT0M"; // Standard "at time of" + // Convert to minutes if divisible, else seconds + if (seconds % 3600 === 0) return `PT${seconds / 3600}H`; + if (seconds % 60 === 0) return `PT${seconds / 60}M`; + return `PT${seconds}S`; + } + + private toVikunjaReminders(reminders?: Reminder[]): any[] | null { + if (!reminders || reminders.length === 0) return null; + + console.log("Vikunja Sync: Converting reminders to push:", JSON.stringify(reminders)); + + const mapped = reminders.map(r => { + if (r.type === "absolute" && r.absoluteTime) { + return { reminder: this.toVikunjaDateTime(r.absoluteTime) }; + } else if (r.type === "relative") { + const seconds = this.durationToSeconds(r.offset); + let relTo = "due_date"; + if (r.relatedTo === "scheduled") relTo = "start_date"; + // If seconds is null (parse fail), skip? Or default 0? + // Vikunja needs reminder set too? No, usually relative_period + relative_to is enough + return { + relative_period: seconds || 0, + relative_to: relTo + }; + } + return null; + }).filter(r => r !== null); + + console.log("Vikunja Sync: Mapped reminders payload:", JSON.stringify(mapped)); + return mapped.length > 0 ? mapped : null; + } + + // ... + + private fromVikunjaReminders(vReminders?: any[]): Reminder[] | undefined { + if (!vReminders || !Array.isArray(vReminders) || vReminders.length === 0) return undefined; + + console.log("Vikunja Sync: Processing reminders from remote:", JSON.stringify(vReminders)); + + const reminders: Reminder[] = []; + for (const vr of vReminders) { + // Generate a stable ID if missing (or use existing) + // If Vikunja doesn't send ID, use hash of content or random. Use random for now as stability is hard without guaranteed properties. + const remId = vr.id ? String(vr.id) : `rem_${Date.now()}_${Math.floor(Math.random() * 1000)}`; + + // Check if relative + if (vr.relative_to) { + let relatedTo: "due" | "scheduled" = "due"; + if (vr.relative_to === "start_date") relatedTo = "scheduled"; + + reminders.push({ + id: remId, + type: "relative", + relatedTo: relatedTo, + offset: this.secondsToDuration(vr.relative_period || 0), + description: "Synced from Vikunja" + }); + } + // Else Absolute (fallback to absolute logic if reminder date exists) + else if (vr.reminder) { + const dateStr = this.fromVikunjaDate(vr.reminder); + if (dateStr) { + const iso = vr.reminder; + if (!iso.startsWith("0001") && !iso.startsWith("0000")) { + reminders.push({ + id: remId, + type: "absolute", + absoluteTime: iso + }); + } + } + } + } + console.log("Vikunja Sync: Mapped local reminders:", JSON.stringify(reminders)); + return reminders.length > 0 ? reminders : undefined; + } + + private fromVikunjaLabels(vLabels?: any[]): string[] | undefined { + if (!vLabels || !Array.isArray(vLabels) || vLabels.length === 0) return undefined; + return vLabels.map(l => l.title); + } + + private async syncTagsToVikunja(vikunjaId: number, tags: string[]) { + try { + console.log(`Vikunja Sync: Syncing tags for task ${vikunjaId}:`, tags); + // 1. Get all available labels + const allLabels = await this.vikunjaService.getLabels(1, 1000); // Fetch up to 1000 labels + let labelList = Array.isArray(allLabels) ? allLabels : []; + // If API returns { labels: [...] } or pages, handle that: + // Assuming flat array or we need to inspect. Vikunja usually returns array. + + const labelsToSet: any[] = []; + + for (const tag of tags) { + let label = labelList.find((l: any) => l.title === tag); + if (!label) { + // Create if not exists + try { + console.log(`Vikunja Sync: Creating label '${tag}'`); + label = await this.vikunjaService.createLabel({ title: tag }); + // Add to local list to avoid re-creating in this loop (if duplicates in tags) + labelList.push(label); + } catch (e) { + console.error(`Vikunja Sync: Failed to create label ${tag}`, e); + continue; + } + } + if (label) { + labelsToSet.push(label); + } + } + + // 2. Bulk update labels on task + // This replaces existing labels with the new set + await this.vikunjaService.updateTaskLabels(vikunjaId, labelsToSet); + console.log(`Vikunja Sync: Updated labels for task ${vikunjaId}`); + } catch (error) { + console.error(`Vikunja Sync: Error syncing tags for task ${vikunjaId}`, error); + } + } + + private async fromVikunjaParent(vTask: any): Promise { + // Get parent from related_tasks.parenttask + console.log(`Vikunja Sync: Task ${vTask.id} ('${vTask.title}') related_tasks:`, JSON.stringify(vTask?.related_tasks)); + const parentTasks = vTask?.related_tasks?.parenttask; + const parentId = parentTasks && parentTasks.length > 0 ? parentTasks[0]?.id : undefined; + + console.log(`Vikunja Sync: Resolving parent for ID: ${parentId}`); + if (!parentId || parentId === 0) return undefined; + + const parentFile = await this.findTaskByVikunjaId(parentId); + if (parentFile) { + console.log(`Vikunja Sync: Found parent file '${parentFile.path}' for Vikunja ID ${parentId}`); + // Create a wikilink to the file + return [`[[${parentFile.basename}]]`]; + } else { + console.log(`Vikunja Sync: Parent file not found for Vikunja ID ${parentId}`); + } + return undefined; + } + + unload() { + if (this.syncIntervalId) { + window.clearInterval(this.syncIntervalId); + } + } +} diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index 5e479035..1ac3cc81 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -7,6 +7,7 @@ import { ProjectAutosuggestSettings, NLPTriggersConfig, GoogleCalendarExportSettings, + VikunjaSettings, } from "../types/settings"; /** @@ -213,6 +214,18 @@ export const DEFAULT_GOOGLE_CALENDAR_EXPORT: GoogleCalendarExportSettings = { defaultReminderMinutes: null, // No reminder by default (user opts in) }; +export const DEFAULT_VIKUNJA_SETTINGS: VikunjaSettings = { + enabled: false, + apiUrl: "", + apiToken: "", + defaultListId: 0, + syncOnTaskCreate: true, + syncOnTaskUpdate: true, + syncOnTaskComplete: true, + enableTwoWaySync: false, + syncInterval: 15, // minutes +}; + export const DEFAULT_PROJECT_AUTOSUGGEST: ProjectAutosuggestSettings = { enableFuzzy: false, rows: ["{title|n(Title)}", "{aliases|n(Aliases)}", "{file.path|n(Path)}"], @@ -407,4 +420,6 @@ export const DEFAULT_SETTINGS: TaskNotesSettings = { microsoftCalendarSyncTokens: {}, // Google Calendar task export settings googleCalendarExport: DEFAULT_GOOGLE_CALENDAR_EXPORT, + // Vikunja Integration defaults + vikunja: DEFAULT_VIKUNJA_SETTINGS, }; diff --git a/src/settings/tabs/integrationsTab.ts b/src/settings/tabs/integrationsTab.ts index 61b45a29..c3b9ef97 100644 --- a/src/settings/tabs/integrationsTab.ts +++ b/src/settings/tabs/integrationsTab.ts @@ -2,6 +2,7 @@ import { Notice, Platform, Modal, Setting, setIcon, App } from "obsidian"; import TaskNotesPlugin from "../../main"; import { WebhookConfig } from "../../types"; import { TranslationKey } from "../../i18n"; +import { VikunjaService } from "../../services/VikunjaService"; import { loadAPIEndpoints } from "../../api/loadAPIEndpoints"; import { createSettingGroup, @@ -751,6 +752,210 @@ export function renderIntegrationsTab( // Initial render renderMicrosoftCalendarCard(); + // ============================================================ + // Vikunja Task Sync Integration Section + // ============================================================ + const vikunjaContainer = container.createDiv("vikunja-integration-container"); + + const renderVikunjaCard = async () => { + vikunjaContainer.empty(); + + // Helper to create toggle rows + const createSyncToggle = (label: string, checked: boolean, onChange: (value: boolean) => void) => { + const toggleContainer = document.createElement("div"); + toggleContainer.style.display = "flex"; + toggleContainer.style.alignItems = "center"; + toggleContainer.style.gap = "8px"; + + const toggle = createCardToggle(checked, onChange); + const labelEl = document.createElement("span"); + labelEl.textContent = label; + labelEl.style.fontSize = "0.9em"; + + toggleContainer.appendChild(toggle); + toggleContainer.appendChild(labelEl); + return toggleContainer; + }; + + // Help text + const helpText = document.createElement("div"); + helpText.className = "tasknotes-calendar-help"; + helpText.innerHTML = "Sync tasks bidirectionally with your Vikunja instance."; + + // Master enable toggle + const enableToggle = createSyncToggle("Enable Vikunja Sync", plugin.settings.vikunja.enabled, (value) => { + plugin.settings.vikunja.enabled = value; + save(); + renderVikunjaCard(); // Re-render to show/hide settings + }); + + // Connection settings (always visible for setup) + const apiUrlInput = createCardUrlInput("https://try.vikunja.io/api/v1", plugin.settings.vikunja.apiUrl); + apiUrlInput.addEventListener("blur", () => { + plugin.settings.vikunja.apiUrl = apiUrlInput.value.trim(); + save(); + }); + + const apiTokenInput = createCardInput("text", "your-api-token", plugin.settings.vikunja.apiToken); + apiTokenInput.setAttribute("type", "password"); + apiTokenInput.addEventListener("blur", () => { + plugin.settings.vikunja.apiToken = apiTokenInput.value.trim(); + save(); + }); + + const listIdInput = createCardNumberInput(0, 999999, 1, plugin.settings.vikunja.defaultListId || 0); + listIdInput.addEventListener("blur", () => { + plugin.settings.vikunja.defaultListId = parseInt(listIdInput.value) || 0; + save(); + }); + + const setupNote = document.createElement("div"); + setupNote.className = "tasknotes-credential-note"; + setupNote.innerHTML = "Get your API token from Vikunja Settings → API Tokens. The List ID is in the URL when viewing a project."; + + // Build sections based on enabled state + const sections: any[] = [ + { + rows: [ + { label: "", input: helpText, fullWidth: true }, + { label: "Enable:", input: enableToggle } + ] + } + ]; + + // Connection settings section (always shown for editing) + sections.push({ + rows: [ + { label: "API URL:", input: apiUrlInput }, + { label: "API Token:", input: apiTokenInput }, + { label: "Default List ID:", input: listIdInput }, + { label: "", input: setupNote, fullWidth: true } + ] + }); + + // Additional settings when enabled + if (plugin.settings.vikunja.enabled) { + const syncIntervalInput = createCardNumberInput(1, 60, 1, plugin.settings.vikunja.syncInterval || 5); + syncIntervalInput.addEventListener("blur", () => { + plugin.settings.vikunja.syncInterval = parseInt(syncIntervalInput.value) || 5; + save(); + }); + + // Sync triggers + const syncTriggersContainer = document.createElement("div"); + syncTriggersContainer.style.display = "flex"; + syncTriggersContainer.style.flexDirection = "column"; + syncTriggersContainer.style.gap = "8px"; + + syncTriggersContainer.appendChild(createSyncToggle("Sync on task create", plugin.settings.vikunja.syncOnTaskCreate, (value) => { + plugin.settings.vikunja.syncOnTaskCreate = value; + save(); + })); + syncTriggersContainer.appendChild(createSyncToggle("Sync on task update", plugin.settings.vikunja.syncOnTaskUpdate, (value) => { + plugin.settings.vikunja.syncOnTaskUpdate = value; + save(); + })); + syncTriggersContainer.appendChild(createSyncToggle("Sync on task complete", plugin.settings.vikunja.syncOnTaskComplete, (value) => { + plugin.settings.vikunja.syncOnTaskComplete = value; + save(); + })); + syncTriggersContainer.appendChild(createSyncToggle("Two-way sync (pull from Vikunja)", plugin.settings.vikunja.enableTwoWaySync, (value) => { + plugin.settings.vikunja.enableTwoWaySync = value; + save(); + })); + + sections.push({ + rows: [ + { label: "Sync Interval (min):", input: syncIntervalInput }, + { label: "Sync Options:", input: syncTriggersContainer } + ] + }); + } + + // Determine status + let isConnected = false; + if (plugin.settings.vikunja.enabled && plugin.settings.vikunja.apiUrl && plugin.settings.vikunja.apiToken) { + try { + const testService = new VikunjaService(plugin, plugin.settings.vikunja); + isConnected = await testService.validateConnection(); + } catch { + isConnected = false; + } + } + + const statusBadge = plugin.settings.vikunja.enabled + ? (isConnected ? createStatusBadge("Connected", "active") : createStatusBadge("Connection Error", "inactive")) + : createStatusBadge("Disabled", "inactive"); + + // Build action buttons + const buttons: any[] = [ + { + text: "Test Connection", + icon: "check-circle", + variant: "default", + onClick: async () => { + const testService = new VikunjaService(plugin, plugin.settings.vikunja); + try { + const valid = await testService.validateConnection(); + if (valid) { + new Notice("Connection successful!"); + renderVikunjaCard(); // Update status badge + } else { + new Notice("Connection failed. Check your credentials."); + } + } catch (error) { + console.error("Connection test failed:", error); + new Notice("Connection failed: " + (error as Error).message); + } + } + } + ]; + + if (plugin.settings.vikunja.enabled) { + buttons.push({ + text: "Sync Now", + icon: "refresh-cw", + variant: "primary", + onClick: async () => { + try { + if (plugin.vikunjaSyncService) { + plugin.vikunjaSyncService.syncFromVikunja(); + new Notice("Vikunja sync started"); + } else { + new Notice("Vikunja sync service not available. Try reloading the plugin."); + } + } catch (error) { + console.error("Failed to sync:", error); + new Notice("Failed to sync with Vikunja"); + } + } + }); + } + + createCard(vikunjaContainer, { + collapsible: true, + defaultCollapsed: false, + colorIndicator: { + color: plugin.settings.vikunja.enabled ? "#00ACC1" : "#737373" + }, + header: { + primaryText: "Vikunja Task Sync", + secondaryText: "Bidirectional task synchronization", + meta: [statusBadge] + }, + content: { + sections: sections + }, + actions: { + buttons: buttons + } + }); + }; + + // Initial render + renderVikunjaCard(); + + // Google Calendar Task Export Section createSettingGroup( container, @@ -1942,8 +2147,8 @@ function renderWebhookList( const createdDate = webhook.createdAt ? new Date(webhook.createdAt) : null; const createdText = createdDate ? translate("settings.integrations.webhooks.statusLabels.created", { - timeAgo: getRelativeTime(createdDate, translate), - }) + timeAgo: getRelativeTime(createdDate, translate), + }) : "Creation date unknown"; // Create events display as a formatted string diff --git a/src/types/settings.ts b/src/types/settings.ts index 4011758a..768305e5 100644 --- a/src/types/settings.ts +++ b/src/types/settings.ts @@ -1,6 +1,18 @@ import { FieldMapping, StatusConfig, PriorityConfig, SavedView, WebhookConfig } from "../types"; import type { FileFilterConfig } from "../suggest/FileSuggestHelper"; +export interface VikunjaSettings { + enabled: boolean; + apiUrl: string; + apiToken: string; + defaultListId: number; + syncOnTaskCreate: boolean; + syncOnTaskUpdate: boolean; + syncOnTaskComplete: boolean; + enableTwoWaySync: boolean; + syncInterval: number; // minutes +} + export interface UserFieldMapping { enabled: boolean; displayName: string; @@ -237,6 +249,9 @@ export interface TaskNotesSettings { microsoftCalendarSyncTokens: Record; // Maps calendar ID to delta link // Google Calendar task export settings googleCalendarExport: GoogleCalendarExportSettings; + + // Vikunja Integration settings + vikunja: VikunjaSettings; } export interface DefaultReminder { @@ -311,11 +326,11 @@ export interface GoogleCalendarExportSettings { export interface CalendarViewSettings { // Default view defaultView: - | "dayGridMonth" - | "timeGridWeek" - | "timeGridDay" - | "multiMonthYear" - | "timeGridCustom"; + | "dayGridMonth" + | "timeGridWeek" + | "timeGridDay" + | "multiMonthYear" + | "timeGridCustom"; // Custom multi-day view settings customDayCount: number; // Number of days to show in custom view (2-10) // Time settings diff --git a/vikunja_api.json b/vikunja_api.json new file mode 100644 index 00000000..8d0a22f4 --- /dev/null +++ b/vikunja_api.json @@ -0,0 +1,9788 @@ +{ + "schemes": [], + "swagger": "2.0", + "info": { + "description": "# Pagination\nEvery endpoint capable of pagination will return two headers:\n* `x-pagination-total-pages`: The total number of available pages for this request\n* `x-pagination-result-count`: The number of items returned for this request.\n# Permissions\nAll endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-permission` header with the max permission the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based on the permissions the user has.\n# Errors\nAll errors have an error code and a human-readable error message in addition to the http status code. You should always check for the status code in the response, not only the http status code.\nDue to limitations in the swagger library we're using for this document, only one error per http status code is documented here. Make sure to check the [error docs](https://vikunja.io/docs/errors/) in Vikunja's documentation for a full list of available error codes.\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully.\n\n**API Token:** You can create scoped API tokens for your user and use the token to make authenticated requests in the context of that user. The token must be provided via an `Authorization: Bearer ` header, similar to jwt auth. See the documentation for the `api` group to manage token creation and revocation.\n\n**BasicAuth:** Only used when requesting tasks via CalDAV.\n", + "title": "Vikunja API", + "contact": { + "name": "General Vikunja contact", + "url": "https://vikunja.io/contact/", + "email": "hello@vikunja.io" + }, + "license": { + "name": "AGPL-3.0-or-later", + "url": "https://code.vikunja.io/api/src/branch/main/LICENSE" + }, + "version": "v1.0.0-rc3-184-0ff6a348" + }, + "host": "", + "basePath": "/api/v1", + "paths": { + "/auth/openid/{provider}/callback": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "After a redirect from the OpenID Connect provider to the frontend has been made with the authentication `code`, this endpoint can be used to obtain a jwt token for that user and thus log them in.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "summary": "Authenticate a user with OpenID Connect", + "operationId": "get-token-openid", + "parameters": [ + { + "description": "The openid callback", + "name": "callback", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/openid.Callback" + } + }, + { + "type": "integer", + "description": "The OpenID Connect provider key as returned by the /info endpoint", + "name": "provider", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/image/{image}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash image. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "project" + ], + "summary": "Get an unsplash image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "image", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The image", + "schema": { + "type": "file" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/image/{image}/thumb": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get an unsplash thumbnail image. The thumbnail is cropped to a max width of 200px. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "project" + ], + "summary": "Get an unsplash thumbnail image", + "parameters": [ + { + "type": "integer", + "description": "Unsplash Image ID", + "name": "image", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The thumbnail", + "schema": { + "type": "file" + } + }, + "404": { + "description": "The image does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/backgrounds/unsplash/search": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Search for a project background from unsplash", + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Search for a background from unsplash", + "parameters": [ + { + "type": "string", + "description": "Search backgrounds from unsplash with this search term.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "p", + "in": "query" + } + ], + "responses": { + "200": { + "description": "An array with photos", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/background.Image" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/filters": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new saved filter", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Creates a new saved filter", + "responses": { + "201": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/filters/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a saved filter by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Gets one saved filter", + "parameters": [ + { + "type": "integer", + "description": "Filter ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a saved filter by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Updates a saved filter", + "parameters": [ + { + "type": "integer", + "description": "Filter ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The saved filter does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Removes a saved filter by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "filter" + ], + "summary": "Removes a saved filter", + "parameters": [ + { + "type": "integer", + "description": "Filter ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The Saved Filter", + "schema": { + "$ref": "#/definitions/models.SavedFilter" + } + }, + "403": { + "description": "The user does not have access to that saved filter.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The saved filter does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/info": { + "get": { + "description": "Returns the version, frontendurl, motd and various settings of Vikunja", + "produces": [ + "application/json" + ], + "tags": [ + "service" + ], + "summary": "Info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.vikunjaInfos" + } + } + } + } + }, + "/labels": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Get all labels a user has access to", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search labels by label text.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The labels", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new label.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Create a label", + "parameters": [ + { + "description": "The label object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Label" + } + } + ], + "responses": { + "201": { + "description": "The created label object.", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/labels/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns one label by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Gets one label", + "parameters": [ + { + "type": "integer", + "description": "Label ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The label", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "403": { + "description": "The user does not have access to the label", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update an existing label. The user needs to be the creator of the label to be able to do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Update a label", + "parameters": [ + { + "type": "integer", + "description": "Label ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The label object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Label" + } + } + ], + "responses": { + "200": { + "description": "The created label object.", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "Not allowed to update the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delete an existing label. The user needs to be the creator of the label to be able to do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Delete a label", + "parameters": [ + { + "type": "integer", + "description": "Label ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The label was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Label" + } + }, + "403": { + "description": "Not allowed to delete the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/login": { + "post": { + "description": "Logs a user in. Returns a JWT-Token to authenticate further requests.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "summary": "Login", + "parameters": [ + { + "description": "The login credentials", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.Login" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "400": { + "description": "Invalid user password model.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Invalid username or password.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Invalid totp passcode.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/microsoft-todo/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from Microsoft Todo to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from Microsoft Todo", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/microsoft-todo/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all tasklinsts, tasks, notes and reminders from Microsoft Todo to Vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all projects, tasks etc. from Microsoft Todo", + "parameters": [ + { + "description": "The auth token previously obtained from the auth url. See the docs for /migration/microsoft-todo/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/microsofttodo.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/microsoft-todo/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/ticktick/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Imports all projects, tasks, notes, reminders, subtasks and files from a TickTick backup export into Vikunja.", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Import all projects, tasks etc. from a TickTick backup export", + "parameters": [ + { + "type": "string", + "description": "The TickTick backup csv file.", + "name": "import", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/ticktick/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from todoist to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from todoist", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all projects, tasks, notes, reminders, subtasks and files from todoist to vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all lists, tasks etc. from todoist", + "parameters": [ + { + "description": "The auth code previously obtained from the auth url. See the docs for /migration/todoist/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/todoist.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/todoist/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/trello/auth": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from trello to Vikunja.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get the auth url from trello", + "responses": { + "200": { + "description": "The auth url.", + "schema": { + "$ref": "#/definitions/handler.AuthURL" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/trello/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Migrates all projects, tasks, notes, reminders, subtasks and files from trello to vikunja.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Migrate all projects, tasks etc. from trello", + "parameters": [ + { + "description": "The auth token previously obtained from the auth url. See the docs for /migration/trello/auth.", + "name": "migrationCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/trello.Migration" + } + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/trello/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/vikunja-file/migrate": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Imports all projects, tasks, notes, reminders, subtasks and files from a Vikunjda data export into Vikunja.", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Import all projects, tasks etc. from a Vikunja data export", + "parameters": [ + { + "type": "string", + "description": "The Vikunja export zip file.", + "name": "import", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "A message telling you everything was migrated successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/migration/vikunja-file/status": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.", + "produces": [ + "application/json" + ], + "tags": [ + "migration" + ], + "summary": "Get migration status", + "responses": { + "200": { + "description": "The migration status", + "schema": { + "$ref": "#/definitions/migration.Status" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/notifications": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns an array with all notifications for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Get all notifications for the current user", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The notifications", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/notifications.DatabaseNotification" + } + } + }, + "403": { + "description": "Link shares cannot have notifications.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Mark all notifications of a user as read", + "responses": { + "200": { + "description": "All notifications marked as read.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/notifications/{id}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Marks a notification as either read or unread. A user can only mark their own notifications as read.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Mark a notification as (un-)read", + "parameters": [ + { + "type": "integer", + "description": "Notification ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The notification to mark as read.", + "schema": { + "$ref": "#/definitions/models.DatabaseNotifications" + } + }, + "403": { + "description": "Link shares cannot have notifications.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The notification does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all projects a user has access to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get all projects a user has access to", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search projects by title.", + "name": "s", + "in": "query" + }, + { + "type": "boolean", + "description": "If true, also returns all archived projects.", + "name": "is_archived", + "in": "query" + }, + { + "type": "string", + "description": "If set to `permissions`, Vikunja will return the max permission the current user has on this project. You can currently only set this to `permissions`.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The projects", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Project" + } + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new project. If a parent project is provided the user needs to have write access to that project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Creates a new project", + "parameters": [ + { + "description": "The project you want to create.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Project" + } + } + ], + "responses": { + "201": { + "description": "The created project.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Gets one project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a project. This does not include adding a task (see below).", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Updates a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The project with updated values you want to update.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Project" + } + } + ], + "responses": { + "200": { + "description": "The updated project.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a project", + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Deletes a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/background": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get the project background of a specific project. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "project" + ], + "summary": "Get the project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project background file.", + "schema": { + "type": "file" + } + }, + "403": { + "description": "No access to this project.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Removes a previously set project background, regardless of the project provider used to set the background. It does not throw an error if the project does not have a background.", + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Remove a project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "403": { + "description": "No access to this project.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/backgrounds/unsplash": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Sets a photo from unsplash as project background.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Set an unsplash photo as project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The image you want to set as background", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/background.Image" + } + } + ], + "responses": { + "200": { + "description": "The background has been successfully set.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid image object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/backgrounds/upload": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a project background.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Upload a project background", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The file as single file.", + "name": "background", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The background was set successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "File is no image.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "File too large.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/projectusers": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lists all users (without emailadresses). Also possible to search for a specific user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get users", + "parameters": [ + { + "type": "string", + "description": "Search for a user by its name.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "All (found) users.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "401": { + "description": "The user does not have the permission to see the project.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/tasks": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Inserts a task into a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a task", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The task object", + "name": "task", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Task" + } + } + ], + "responses": { + "201": { + "description": "The created task object.", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "400": { + "description": "Invalid task object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/teams": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project with all teams which have access on a given project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get teams on a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search teams by its name.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The teams with their permission.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamWithPermission" + } + } + }, + "403": { + "description": "No permission to see the project.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Gives a team access to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Add a team to a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The team you want to add to the project.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + } + ], + "responses": { + "201": { + "description": "The created team\u003c-\u003eproject relation.", + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + }, + "400": { + "description": "Invalid team project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The team does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/users": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project with all users which have access on a given project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get users on a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search users by its name.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The users with the permission they have.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.UserWithPermission" + } + } + }, + "403": { + "description": "No permission to see the project.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Gives a user access to a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Add a user to a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The user you want to add to the project.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + } + ], + "responses": { + "201": { + "description": "The created user\u003c-\u003eproject relation.", + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + }, + "400": { + "description": "Invalid user project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/views/{view}/buckets": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all kanban buckets which belong to that project. Buckets are always sorted by their `position` in ascending order. To get all buckets with their tasks, use the tasks endpoint with a kanban view.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get all kanban buckets of a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The buckets", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Bucket" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new kanban bucket on a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Create a new bucket", + "parameters": [ + { + "type": "integer", + "description": "Project Id", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/views/{view}/tasks": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all tasks for the selected project. When the requested view is a kanban view, a list of buckets containing the tasks will be returned. Otherwise, a list of tasks will be returned.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get tasks in a project", + "parameters": [ + { + "type": "integer", + "description": "The project ID.", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The project view ID.", + "name": "view", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search tasks by task text.", + "name": "s", + "in": "query" + }, + { + "type": "string", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`.", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`.", + "name": "order_by", + "in": "query" + }, + { + "type": "string", + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation of the feature.", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "description": "The time zone which should be used for date match (statements like ", + "name": "filter_timezone", + "in": "query" + }, + { + "type": "string", + "description": "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`.", + "name": "filter_include_nulls", + "in": "query" + }, + { + "type": "array", + "description": "If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. If set to `buckets`, the buckets of each task will be present in the response. If set to `reactions`, the reactions of each task will be present in the response. If set to `comments`, the first 50 comments of each task will be present in the response. You can set this multiple times with different values.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/webhooks": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all api webhook targets for the specified project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Get all api webhook targets for the specified project", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per bucket per page. This parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The list of all webhook targets", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Webhook" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a webhook target which receives POST requests about specified events from a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Create a webhook target", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The webhook target object with required fields", + "name": "webhook", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Webhook" + } + } + ], + "responses": { + "200": { + "description": "The created webhook target.", + "schema": { + "$ref": "#/definitions/models.Webhook" + } + }, + "400": { + "description": "Invalid webhook object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{id}/webhooks/{webhookID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Change a webhook target's events. You cannot change other values of a webhook.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Change a webhook target's events.", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Webhook ID", + "name": "webhookID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Updated webhook target", + "schema": { + "$ref": "#/definitions/models.Webhook" + } + }, + "404": { + "description": "The webhok target does not exist", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delete any of the project's webhook targets.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Deletes an existing webhook target", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Webhook ID", + "name": "webhookID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The webhok target does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/duplicate": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Copies the project, tasks, files, kanban data, assignees, comments, attachments, labels, relations, backgrounds, user/team permissions and link shares from one project to a new one. The user needs read access in the project and write access in the parent of the new project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Duplicate an existing project", + "parameters": [ + { + "type": "integer", + "description": "The project ID to duplicate", + "name": "projectID", + "in": "path", + "required": true + }, + { + "description": "The target parent project which should hold the copied project.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectDuplicate" + } + } + ], + "responses": { + "201": { + "description": "The created project.", + "schema": { + "$ref": "#/definitions/models.ProjectDuplicate" + } + }, + "400": { + "description": "Invalid project duplicate object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project or its parent.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/teams/{teamID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update a team \u003c-\u003e project relation. Mostly used to update the permission that team has.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Update a team \u003c-\u003e project relation", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Team ID", + "name": "teamID", + "in": "path", + "required": true + }, + { + "description": "The team you want to update.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + } + ], + "responses": { + "200": { + "description": "The updated team \u003c-\u003e project relation.", + "schema": { + "$ref": "#/definitions/models.TeamProject" + } + }, + "403": { + "description": "The user does not have admin-access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Team or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a team from a project. The team won't have access to the project anymore.", + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Delete a team from a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Team ID", + "name": "teamID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Team or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/users/{userID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update a user \u003c-\u003e project relation. Mostly used to update the permission that user has.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Update a user \u003c-\u003e project relation", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "User ID", + "name": "userID", + "in": "path", + "required": true + }, + { + "description": "The user you want to update.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + } + ], + "responses": { + "200": { + "description": "The updated user \u003c-\u003e project relation.", + "schema": { + "$ref": "#/definitions/models.ProjectUser" + } + }, + "403": { + "description": "The user does not have admin-access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a user from a project. The user won't have access to the project anymore.", + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Delete a user from a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "User ID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The user was successfully removed from the project.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "user or project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{projectID}/views/{view}/buckets/{bucketID}": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates an existing kanban bucket.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Update an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "Project Id", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + }, + { + "description": "The bucket object", + "name": "bucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Bucket" + } + } + ], + "responses": { + "200": { + "description": "The created bucket object.", + "schema": { + "$ref": "#/definitions/models.Bucket" + } + }, + "400": { + "description": "Invalid bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes an existing kanban bucket and dissociates all of its task. It does not delete any tasks. You cannot delete the last bucket on a project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Deletes an existing bucket", + "parameters": [ + { + "type": "integer", + "description": "Project Id", + "name": "projectID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket Id", + "name": "bucketID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project view ID", + "name": "view", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The bucket does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/shares": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all link shares which exist for a given project", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get all link shares for a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search shares by hash.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The share links", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.LinkSharing" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Share a project via link. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Share a project via link", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "description": "The new link share object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LinkSharing" + } + } + ], + "responses": { + "201": { + "description": "The created link share object.", + "schema": { + "$ref": "#/definitions/models.LinkSharing" + } + }, + "400": { + "description": "Invalid link share object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "Not allowed to add the project share.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The project does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/shares/{share}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns one link share by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get one link shares for a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Share ID", + "name": "share", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The share links", + "schema": { + "$ref": "#/definitions/models.LinkSharing" + } + }, + "403": { + "description": "No access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Share Link not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a link share. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Remove a link share", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Share Link ID", + "name": "share", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The link was successfully removed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Not allowed to remove the link.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Share Link not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/views": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all project views for a sepcific project", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get all project views for a project", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project views", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.ProjectView" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a project view in a specific project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Create a project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "description": "The project view you want to create.", + "name": "view", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + } + ], + "responses": { + "200": { + "description": "The created project view", + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + }, + "403": { + "description": "The user does not have access to create a project view", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/views/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a project view by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Get one project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project view", + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + }, + "403": { + "description": "The user does not have access to this project view", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a project view.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Updates a project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The project view with updated values you want to change.", + "name": "view", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + } + ], + "responses": { + "200": { + "description": "The updated project view.", + "schema": { + "$ref": "#/definitions/models.ProjectView" + } + }, + "400": { + "description": "Invalid project view object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes a project view.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Delete a project view", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The project view was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the project view", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/projects/{project}/views/{view}/buckets/{bucket}/tasks": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a task in a bucket", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update a task bucket", + "parameters": [ + { + "type": "integer", + "description": "Project ID", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Project View ID", + "name": "view", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Bucket ID", + "name": "bucket", + "in": "path", + "required": true + }, + { + "description": "The id of the task you want to move into the bucket.", + "name": "taskBucket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskBucket" + } + } + ], + "responses": { + "200": { + "description": "The updated task bucket.", + "schema": { + "$ref": "#/definitions/models.TaskBucket" + } + }, + "400": { + "description": "Invalid task bucket object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/register": { + "post": { + "description": "Creates a new user account.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "summary": "Register", + "parameters": [ + { + "description": "The user with credentials to create", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserRegister" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.User" + } + }, + "400": { + "description": "No or invalid user register object provided / User already exists.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/routes": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a list of all API routes which are available to use with an api token, not a user login.", + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Get a list of all token api routes", + "responses": { + "200": { + "description": "The list of all routes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.APITokenRoute" + } + } + } + } + } + }, + "/shares/{share}/auth": { + "post": { + "description": "Get a jwt auth token for a shared project from a share hash.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "sharing" + ], + "summary": "Get an auth token for a share", + "parameters": [ + { + "description": "The password for link shares which require one.", + "name": "password", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.LinkShareAuth" + } + }, + { + "type": "string", + "description": "The share hash", + "name": "share", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The valid jwt auth token.", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "400": { + "description": "Invalid link share object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/subscriptions/{entity}/{entityID}": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Subscribes the current user to an entity.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Subscribes the current user to an entity.", + "parameters": [ + { + "type": "string", + "description": "The entity the user subscribes to. Can be either `project` or `task`.", + "name": "entity", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The numeric id of the entity to subscribe to.", + "name": "entityID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The subscription", + "schema": { + "$ref": "#/definitions/models.Subscription" + } + }, + "403": { + "description": "The user does not have access to subscribe to this entity.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "412": { + "description": "The subscription entity is invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Unsubscribes the current user to an entity.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "subscriptions" + ], + "summary": "Unsubscribe the current user from an entity.", + "parameters": [ + { + "type": "string", + "description": "The entity the user subscribed to. Can be either `project` or `task`.", + "name": "entity", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The numeric id of the subscribed entity to.", + "name": "entityID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The subscription", + "schema": { + "$ref": "#/definitions/models.Subscription" + } + }, + "403": { + "description": "The user does not have access to subscribe to this entity.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The subscription does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all tasks on any project the user has access to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get tasks", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search tasks by task text.", + "name": "s", + "in": "query" + }, + { + "type": "string", + "description": "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at`, `due_date`, `created_by_id`, `project_id`, `repeat_after`, `priority`, `start_date`, `end_date`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`.", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`.", + "name": "order_by", + "in": "query" + }, + { + "type": "string", + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation of the feature.", + "name": "filter", + "in": "query" + }, + { + "type": "string", + "description": "The time zone which should be used for date match (statements like ", + "name": "filter_timezone", + "in": "query" + }, + { + "type": "string", + "description": "If set to true the result will include filtered fields whose value is set to `null`. Available values are `true` or `false`. Defaults to `false`.", + "name": "filter_include_nulls", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. If set to `buckets`, the buckets of each task will be present in the response. If set to `reactions`, the reactions of each task will be present in the response. If set to `comments`, the first 50 comments of each task will be present in the response. You can set this multiple times with different values.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/bulk": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates multiple tasks atomically. All provided tasks must be writable by the user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update multiple tasks", + "parameters": [ + { + "description": "Bulk task update payload", + "name": "bulkTask", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.BulkTask" + } + } + ], + "responses": { + "200": { + "description": "Updated tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "400": { + "description": "Invalid request", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the tasks", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns one task by its ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get one task", + "parameters": [ + { + "type": "integer", + "description": "The task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "If set to `subtasks`, Vikunja will fetch only tasks which do not have subtasks and then in a second step, will fetch all of these subtasks. This may result in more tasks than the pagination limit being returned, but all subtasks will be present in the response. If set to `buckets`, the buckets of each task will be present in the response. If set to `reactions`, the reactions of each task will be present in the response. If set to `comments`, the first 50 comments of each task will be present in the response. You can set this multiple times with different values.", + "name": "expand", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The task", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "404": { + "description": "Task not found", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a task. This includes marking it as done. Assignees you pass will be updated, see their individual endpoints for more details on how this is done. To update labels, see the description of the endpoint.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update a task", + "parameters": [ + { + "type": "integer", + "description": "The Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The task object", + "name": "task", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Task" + } + } + ], + "responses": { + "200": { + "description": "The updated task object.", + "schema": { + "$ref": "#/definitions/models.Task" + } + }, + "400": { + "description": "Invalid task object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the task (aka its project)", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Deletes a task from a project. This does not mean \"mark it done\".", + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Delete a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The created task object.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task ID provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{id}/attachments": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all task attachments for one task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all attachments for one task.", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "All attachments for this task", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskAttachment" + } + } + }, + "403": { + "description": "No access to this task.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The task does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a task attachment. You can pass multiple files with the files form param.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Upload a task attachment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The file, as multipart form file. You can pass multiple.", + "name": "files", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "Attachments were uploaded successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "No access to the task.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The task does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{id}/attachments/{attachmentID}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get one attachment for download. **Returns json on error.**", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "task" + ], + "summary": "Get one attachment.", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Attachment ID", + "name": "attachmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The size of the preview image. Can be sm = 100px, md = 200px, lg = 400px or xl = 800px. If provided, a preview image will be returned if the attachment is an image.", + "name": "preview_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The attachment file.", + "schema": { + "type": "file" + } + }, + "403": { + "description": "No access to this task.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The task does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delete an attachment.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Delete an attachment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Attachment ID", + "name": "attachmentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The attachment was deleted successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "No access to this task.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The task does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{id}/position": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a task position.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Updates a task position", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The task position with updated values you want to change.", + "name": "view", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskPosition" + } + } + ], + "responses": { + "200": { + "description": "The updated task position.", + "schema": { + "$ref": "#/definitions/models.TaskPosition" + } + }, + "400": { + "description": "Invalid task position object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{projecttask}/read": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Marks a task as read for the current user by removing the unread status entry.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Mark a task as read", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "projecttask", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task unread status object.", + "schema": { + "$ref": "#/definitions/models.TaskUnreadStatus" + } + }, + "403": { + "description": "The user does not have access to the task", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/assignees": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns an array with all assignees for this task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Get all assignees for a task", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search assignees by their username.", + "name": "s", + "in": "query" + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The assignees", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Adds a new assignee to a task. The assignee needs to have access to the project, the doer must be able to edit this task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Add a new assignee to a task", + "parameters": [ + { + "description": "The assingee object", + "name": "assignee", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskAssginee" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created assingee object.", + "schema": { + "$ref": "#/definitions/models.TaskAssginee" + } + }, + "400": { + "description": "Invalid assignee object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/assignees/bulk": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Adds multiple new assignees to a task. The assignee needs to have access to the project, the doer must be able to edit this task. Every user not in the project will be unassigned from the task, pass an empty array to unassign everyone.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Add multiple new assignees to a task", + "parameters": [ + { + "description": "The array of assignees", + "name": "assignee", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.BulkAssignees" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created assingees object.", + "schema": { + "$ref": "#/definitions/models.TaskAssginee" + } + }, + "400": { + "description": "Invalid assignee object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/assignees/{userID}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Un-assign a user from a task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "assignees" + ], + "summary": "Delete an assignee", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Assignee user ID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The assignee was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Not allowed to delete the assignee.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all task comments. The user doing this need to have at least read access to the task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all task comments", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The array with all task comments", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskComment" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a new task comment. The user doing this need to have at least write access to the task this comment should belong to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new task comment", + "parameters": [ + { + "description": "The task comment object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/comments/{commentID}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least read access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Update an existing task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Update an existing task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The updated task comment object.", + "schema": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a task comment. The user doing this need to have at least write access to the task this comment belongs to.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task comment", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Comment ID", + "name": "commentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task comment was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task comment object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task comment was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/labels/bulk": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates all labels on a task. Every label which is not passed but exists on the task will be deleted. Every label which does not exist on the task will be added. All labels which are passed and already exist on the task won't be touched.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Update all labels on a task.", + "parameters": [ + { + "description": "The array of labels", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LabelTaskBulk" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The updated labels object.", + "schema": { + "$ref": "#/definitions/models.LabelTaskBulk" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/relations": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new relation between two tasks. The user needs to have update permissions on the base task and at least read permissions on the other task. Both tasks do not need to be on the same project. Take a look at the docs for available task relation kinds.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Create a new relation between two tasks", + "parameters": [ + { + "description": "The relation object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskRelation" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "The created task relation object.", + "schema": { + "$ref": "#/definitions/models.TaskRelation" + } + }, + "400": { + "description": "Invalid task relation object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{taskID}/relations/{relationKind}/{otherTaskID}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Remove a task relation", + "parameters": [ + { + "description": "The relation object", + "name": "relation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TaskRelation" + } + }, + { + "type": "integer", + "description": "Task ID", + "name": "taskID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The kind of the relation. See the TaskRelation type for more info.", + "name": "relationKind", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The id of the other task.", + "name": "otherTaskID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The task relation was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid task relation object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The task relation was not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{task}/labels": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all labels which are assicociated with a given task.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Get all labels on a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search labels by label text.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The labels", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Add a label to a task. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Add a label to a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "description": "The label object", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.LabelTask" + } + } + ], + "responses": { + "201": { + "description": "The created label relation object.", + "schema": { + "$ref": "#/definitions/models.LabelTask" + } + }, + "400": { + "description": "Invalid label object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "Not allowed to add the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "The label does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tasks/{task}/labels/{label}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a label from a task. The user needs to have write-access to the project to be able do this.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "labels" + ], + "summary": "Remove a label from a task", + "parameters": [ + { + "type": "integer", + "description": "Task ID", + "name": "task", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Label ID", + "name": "label", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The label was successfully removed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "Not allowed to remove the label.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "Label not found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all teams the current user is part of.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Get teams", + "parameters": [ + { + "type": "integer", + "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search teams by its name.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The teams.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Team" + } + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new team.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Creates a new team", + "parameters": [ + { + "description": "The team you want to create.", + "name": "team", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Team" + } + } + ], + "responses": { + "201": { + "description": "The created team.", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "400": { + "description": "Invalid team object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams/{id}": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a team by its ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Gets one team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "403": { + "description": "The user does not have access to the team", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Updates a team.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Updates a team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The team with updated values you want to update.", + "name": "team", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Team" + } + } + ], + "responses": { + "200": { + "description": "The updated team.", + "schema": { + "$ref": "#/definitions/models.Team" + } + }, + "400": { + "description": "Invalid team object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delets a team. This will also remove the access for all users in that team.", + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Deletes a team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The team was successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Invalid team object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams/{id}/members": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Add a user to a team.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Add a user to a team", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "The user to be added to a team.", + "name": "team", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.TeamMember" + } + } + ], + "responses": { + "201": { + "description": "The newly created member object", + "schema": { + "$ref": "#/definitions/models.TeamMember" + } + }, + "400": { + "description": "Invalid member object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the team", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams/{id}/members/{userID}/admin": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "If a user is team admin, this will make them member and vise-versa.", + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Toggle a team member's admin status", + "parameters": [ + { + "type": "integer", + "description": "Team ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "User ID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The member permission was successfully changed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/teams/{id}/members/{username}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Remove a user from a team. This will also revoke any access this user might have via that team. A user can remove themselves from the team if they are not the last user in the team.", + "produces": [ + "application/json" + ], + "tags": [ + "team" + ], + "summary": "Remove a user from a team", + "parameters": [ + { + "type": "integer", + "description": "The ID of the team you want to remove th user from", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The username of the user you want to remove", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The user was successfully removed from the team.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/test/{table}": { + "patch": { + "description": "Fills the specified table with the content provided in the payload. You need to enable the testing endpoint before doing this and provide the `Authorization: \u003ctoken\u003e` secret when making requests to this endpoint. See docs for more details.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "testing" + ], + "summary": "Reset the db to a defined state", + "parameters": [ + { + "type": "string", + "description": "The table to reset", + "name": "table", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "Everything has been imported successfully.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tokens": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all api tokens the current user has created.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Get all api tokens of the current user", + "parameters": [ + { + "type": "integer", + "description": "The page number, used for pagination. If not provided, the first page of results is returned.", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The maximum number of tokens per page. This parameter is limited by the configured maximum of items per page.", + "name": "per_page", + "in": "query" + }, + { + "type": "string", + "description": "Search tokens by their title.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The list of all tokens", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.APIToken" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Create a new api token to use on behalf of the user creating it.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Create a new api token", + "parameters": [ + { + "description": "The token object with required fields", + "name": "token", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.APIToken" + } + } + ], + "responses": { + "200": { + "description": "The created token.", + "schema": { + "$ref": "#/definitions/models.APIToken" + } + }, + "400": { + "description": "Invalid token object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/tokens/{tokenID}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Delete any of the user's api tokens.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "api" + ], + "summary": "Deletes an existing api token", + "parameters": [ + { + "type": "integer", + "description": "Token ID", + "name": "tokenID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully deleted.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The token does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user object with their settings.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get user information", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.UserWithSettings" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/confirm": { + "post": { + "description": "Confirms the email of a newly registered user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Confirm the email of a new user", + "parameters": [ + { + "description": "The token.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.EmailConfirm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad token provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/deletion/cancel": { + "post": { + "description": "Aborts an in-progress user deletion.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Abort a user deletion request", + "parameters": [ + { + "description": "The user password to confirm.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad password provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/deletion/confirm": { + "post": { + "description": "Confirms the deletion request of a user sent via email.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Confirm a user deletion request", + "parameters": [ + { + "description": "The token.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserDeletionRequestConfirm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad token provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/deletion/request": { + "post": { + "description": "Requests the deletion of the current user. It will trigger an email which has to be confirmed to start the deletion.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Request the deletion of the user", + "parameters": [ + { + "description": "The user password.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "412": { + "description": "Bad password provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/export": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get current user data export", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.UserExportStatus" + } + } + } + } + }, + "/user/export/download": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Download a user data export.", + "parameters": [ + { + "description": "User password to confirm the download.", + "name": "password", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "No user data export found.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/export/request": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Request a user data export.", + "parameters": [ + { + "description": "User password to confirm the data export request.", + "name": "password", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPasswordConfirmation" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/password": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lets the current user change its password.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Change password", + "parameters": [ + { + "description": "The current and new password.", + "name": "userPassword", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserPassword" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/password/reset": { + "post": { + "description": "Resets a user email with a previously reset token.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Resets a password", + "parameters": [ + { + "description": "The token with the new password.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.PasswordReset" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Bad token provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/password/token": { + "post": { + "description": "Requests a token to reset a users password. The token is sent via email.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Request password reset token", + "parameters": [ + { + "description": "The username of the user to request a token for.", + "name": "credentials", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.PasswordTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/avatar": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user's avatar setting.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Return user avatar setting", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.UserAvatarProvider" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Changes the user avatar. Valid types are gravatar (uses the user email), upload, initials, marble, ldap (synced from LDAP server), openid (synced from OpenID provider), default.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Set the user's avatar", + "parameters": [ + { + "description": "The user's avatar setting", + "name": "avatar", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserAvatarProvider" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/avatar/upload": { + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Upload a user avatar. This will also set the user's avatar provider to \"upload\"", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Upload a user avatar", + "parameters": [ + { + "type": "string", + "description": "The avatar as single file.", + "name": "avatar", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The avatar was set successfully.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "File is no image.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "File too large.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/email": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Lets the current user change their email address.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Update email address", + "parameters": [ + { + "description": "The new email address and current password.", + "name": "userEmailUpdate", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.EmailUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/general": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Change general user settings of the current user.", + "parameters": [ + { + "description": "The updated user settings", + "name": "avatar", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.UserSettings" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/token/caldav": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Return the IDs and created dates of all caldav tokens for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Returns the caldav tokens for the current user", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.Token" + } + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Generates a caldav token which can be used for the caldav api. It is not possible to see the token again after it was generated.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Generate a caldav token", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.Token" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/token/caldav/{id}": { + "delete": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Delete a caldav token by id", + "parameters": [ + { + "type": "integer", + "description": "Token ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns the current user totp setting or an error if it is not enabled.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp setting for the current user", + "responses": { + "200": { + "description": "The totp settings.", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/disable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Disables any totp settings for the current user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Disable totp settings", + "parameters": [ + { + "description": "The current user's password (only password is enough).", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.Login" + } + } + ], + "responses": { + "200": { + "description": "Successfully disabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enable": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Enables a previously enrolled totp setting by providing a totp passcode.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enable a previously enrolled totp setting.", + "parameters": [ + { + "description": "The totp passcode.", + "name": "totp", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.TOTPPasscode" + } + } + ], + "responses": { + "200": { + "description": "Successfully enabled", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "412": { + "description": "TOTP is not enrolled.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/enroll": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates an initial setup for the user in the db. After this step, the user needs to verify they have a working totp setup with the \"enable totp\" endpoint.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Enroll a user into totp", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.TOTP" + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "404": { + "description": "User does not exist.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/settings/totp/qrcode": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns a qr code for easier setup at end user's devices.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Totp QR Code", + "responses": { + "200": { + "description": "The qr code as jpeg image", + "schema": { + "type": "file" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/timezones": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Because available time zones depend on the system Vikunja is running on, this endpoint returns a project of all valid time zones this particular Vikunja instance can handle. The project of time zones is not sorted, you should sort it on the client.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get all available time zones on this vikunja instance", + "responses": { + "200": { + "description": "All available time zones.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/user/token": { + "post": { + "description": "Returns a new valid jwt user token with an extended length.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Renew user token", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/auth.Token" + } + }, + "400": { + "description": "Only user token are available for renew.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/users": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Search for a user by its username, name or full email. Name (not username) or email require that the user has enabled this in their settings.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "summary": "Get users", + "parameters": [ + { + "type": "string", + "description": "The search criteria.", + "name": "s", + "in": "query" + } + ], + "responses": { + "200": { + "description": "All (found) users.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "400": { + "description": "Something's invalid.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal server error.", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/webhooks/events": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Get all possible webhook events to use when creating or updating a webhook target.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhooks" + ], + "summary": "Get all possible webhook events", + "responses": { + "200": { + "description": "The list of all possible webhook events", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/{kind}/{id}/reactions": { + "get": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Returns all reactions for an entity", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Get all reactions for an entity", + "parameters": [ + { + "type": "integer", + "description": "Entity ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The kind of the entity. Can be either `tasks` or `comments` for task comments", + "name": "kind", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "The reactions", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.ReactionMap" + } + } + }, + "403": { + "description": "The user does not have access to the entity", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Add a reaction to an entity. Will do nothing if the reaction already exists.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Add a reaction to an entity", + "parameters": [ + { + "type": "integer", + "description": "Entity ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The kind of the entity. Can be either `tasks` or `comments` for task comments", + "name": "kind", + "in": "path", + "required": true + }, + { + "description": "The reaction you want to add to the entity.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Reaction" + } + } + ], + "responses": { + "200": { + "description": "The created reaction", + "schema": { + "$ref": "#/definitions/models.Reaction" + } + }, + "403": { + "description": "The user does not have access to the entity", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/{kind}/{id}/reactions/delete": { + "post": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Removes the reaction of that user on that entity.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "task" + ], + "summary": "Removes the user's reaction", + "parameters": [ + { + "type": "integer", + "description": "Entity ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The kind of the entity. Can be either `tasks` or `comments` for task comments", + "name": "kind", + "in": "path", + "required": true + }, + { + "description": "The reaction you want to add to the entity.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Reaction" + } + } + ], + "responses": { + "200": { + "description": "The reaction was successfully removed.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "403": { + "description": "The user does not have access to the entity", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + }, + "/{username}/avatar": { + "get": { + "description": "Returns the user avatar as image.", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "user" + ], + "summary": "User Avatar", + "parameters": [ + { + "type": "string", + "description": "The username of the user who's avatar you want to get", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "The size of the avatar you want to get. If bigger than the max configured size this will be adjusted to the maximum size.", + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The avatar", + "schema": { + "type": "file" + } + }, + "404": { + "description": "The user does not exist.", + "schema": { + "$ref": "#/definitions/models.Message" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } + } + } + }, + "definitions": { + "auth.Token": { + "type": "object", + "properties": { + "token": { + "type": "string", + "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + } + }, + "background.Image": { + "type": "object", + "properties": { + "blur_hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "info": { + "description": "This can be used to supply extra information from an image provider to clients" + }, + "thumb": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "code_vikunja_io_api_pkg_modules_auth_openid.Provider": { + "type": "object", + "properties": { + "auth_url": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "email_fallback": { + "type": "boolean" + }, + "force_user_info": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "logout_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "username_fallback": { + "type": "boolean" + } + } + }, + "files.File": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "mime": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "integer" + } + } + }, + "handler.AuthURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "microsofttodo.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "migration.Status": { + "type": "object", + "properties": { + "finished_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "migrator_name": { + "type": "string" + }, + "started_at": { + "type": "string" + } + } + }, + "models.APIPermissions": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "models.APIToken": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this api key was created. You cannot change this value.", + "type": "string" + }, + "expires_at": { + "description": "The date when this key expires.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this api key.", + "type": "integer" + }, + "permissions": { + "description": "The permissions this token has. Possible values are available via the /routes endpoint and consist of the keys of the list from that endpoint. For example, if the token should be able to read all tasks as well as update existing tasks, you should add `{\"tasks\":[\"read_all\",\"update\"]}`.", + "allOf": [ + { + "$ref": "#/definitions/models.APIPermissions" + } + ] + }, + "title": { + "description": "A human-readable name for this token", + "type": "string" + }, + "token": { + "description": "The actual api key. Only visible after creation.", + "type": "string" + } + } + }, + "models.APITokenRoute": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/models.RouteDetail" + } + }, + "models.Bucket": { + "type": "object", + "properties": { + "count": { + "description": "The number of tasks currently in this bucket", + "type": "integer" + }, + "created": { + "description": "A timestamp when this bucket was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the bucket.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "id": { + "description": "The unique, numeric id of this bucket.", + "type": "integer" + }, + "limit": { + "description": "How many tasks can be at the same time on this board max", + "type": "integer", + "minimum": 0 + }, + "position": { + "description": "The position this bucket has when querying all buckets. See the tasks.position property on how to use this.", + "type": "number" + }, + "project_view_id": { + "description": "The project view this bucket belongs to.", + "type": "integer" + }, + "tasks": { + "description": "All tasks which belong to this bucket.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + }, + "title": { + "description": "The title of this bucket.", + "type": "string", + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this bucket was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.BulkAssignees": { + "type": "object", + "properties": { + "assignees": { + "description": "A project with all assignees", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + } + }, + "models.BulkTask": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + }, + "values": { + "$ref": "#/definitions/models.Task" + } + } + }, + "models.DatabaseNotifications": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this notification was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this notification.", + "type": "integer" + }, + "name": { + "description": "The name of the notification", + "type": "string" + }, + "notification": { + "description": "The actual content of the notification." + }, + "read": { + "description": "Whether or not to mark this notification as read or unread.\nTrue is read, false is unread.", + "type": "boolean" + }, + "read_at": { + "description": "When this notification is marked as read, this will be updated with the current timestamp.", + "type": "string" + } + } + }, + "models.Label": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this label", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The label description.", + "type": "string" + }, + "hex_color": { + "description": "The color this label has in hex format.", + "type": "string", + "maxLength": 7 + }, + "id": { + "description": "The unique, numeric id of this label.", + "type": "integer" + }, + "title": { + "description": "The title of the label. You'll see this one on tasks associated with it.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this label was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.LabelTask": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "label_id": { + "description": "The label id you want to associate with a task.", + "type": "integer" + } + } + }, + "models.LabelTaskBulk": { + "type": "object", + "properties": { + "labels": { + "description": "All labels you want to update at once.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + } + } + }, + "models.LinkSharing": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this project was shared. You cannot change this value.", + "type": "string" + }, + "hash": { + "description": "The public id to get this shared project", + "type": "string" + }, + "id": { + "description": "The ID of the shared thing", + "type": "integer" + }, + "name": { + "description": "The name of this link share. All actions someone takes while being authenticated with that link will appear with that name.", + "type": "string" + }, + "password": { + "description": "The password of this link share. You can only set it, not retrieve it after the link share has been created.", + "type": "string" + }, + "permission": { + "description": "The permission this project is shared with. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.Permission" + } + ] + }, + "shared_by": { + "description": "The user who shared this project", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "sharing_type": { + "description": "The kind of this link. 0 = undefined, 1 = without password, 2 = with password.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.SharingType" + } + ] + }, + "updated": { + "description": "A timestamp when this share was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.Message": { + "type": "object", + "properties": { + "message": { + "description": "A standard message.", + "type": "string" + } + } + }, + "models.Permission": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "PermissionRead", + "PermissionWrite", + "PermissionAdmin" + ] + }, + "models.Project": { + "type": "object", + "properties": { + "background_blur_hash": { + "description": "Contains a very small version of the project background to use as a blurry preview until the actual background is loaded. Check out https://blurha.sh/ to learn how it works.", + "type": "string" + }, + "background_information": { + "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background" + }, + "created": { + "description": "A timestamp when this project was created. You cannot change this value.", + "type": "string" + }, + "description": { + "description": "The description of the project.", + "type": "string" + }, + "hex_color": { + "description": "The hex color of this project", + "type": "string", + "maxLength": 7 + }, + "id": { + "description": "The unique, numeric id of this project.", + "type": "integer" + }, + "identifier": { + "description": "The unique project short identifier. Used to build task identifiers.", + "type": "string", + "maxLength": 10, + "minLength": 0 + }, + "is_archived": { + "description": "Whether a project is archived.", + "type": "boolean" + }, + "is_favorite": { + "description": "True if a project is a favorite. Favorite projects show up in a separate parent project. This value depends on the user making the call to the api.", + "type": "boolean" + }, + "max_permission": { + "$ref": "#/definitions/models.Permission" + }, + "owner": { + "description": "The user who created this project.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "parent_project_id": { + "type": "integer" + }, + "position": { + "description": "The position this project has when querying all projects. See the tasks.position property on how to use this.", + "type": "number" + }, + "subscription": { + "description": "The subscription status for the user reading this project. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retreiving one project.", + "allOf": [ + { + "$ref": "#/definitions/models.Subscription" + } + ] + }, + "title": { + "description": "The title of the project. You'll see this in the overview.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this project was last updated. You cannot change this value.", + "type": "string" + }, + "views": { + "type": "array", + "items": { + "$ref": "#/definitions/models.ProjectView" + } + } + } + }, + "models.ProjectDuplicate": { + "type": "object", + "properties": { + "duplicated_project": { + "description": "The copied project", + "allOf": [ + { + "$ref": "#/definitions/models.Project" + } + ] + }, + "parent_project_id": { + "description": "The target parent project", + "type": "integer" + } + } + }, + "models.ProjectUser": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this project \u003c-\u003e user relation.", + "type": "integer" + }, + "permission": { + "description": "The permission this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.Permission" + } + ] + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username.", + "type": "string" + } + } + }, + "models.ProjectView": { + "type": "object", + "properties": { + "bucket_configuration": { + "description": "When the bucket configuration mode is not `manual`, this field holds the options of that configuration.", + "type": "array", + "items": { + "$ref": "#/definitions/models.ProjectViewBucketConfiguration" + } + }, + "bucket_configuration_mode": { + "description": "The bucket configuration mode. Can be `none`, `manual` or `filter`. `manual` allows to move tasks between buckets as you normally would. `filter` creates buckets based on a filter for each bucket.", + "type": "string", + "enum": [ + "none", + "manual", + "filter", + "manual" + ] + }, + "created": { + "description": "A timestamp when this reaction was created. You cannot change this value.", + "type": "string" + }, + "default_bucket_id": { + "description": "The ID of the bucket where new tasks without a bucket are added to. By default, this is the leftmost bucket in a view.", + "type": "integer" + }, + "done_bucket_id": { + "description": "If tasks are moved to the done bucket, they are marked as done. If they are marked as done individually, they are moved into the done bucket.", + "type": "integer" + }, + "filter": { + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation.", + "allOf": [ + { + "$ref": "#/definitions/models.TaskCollection" + } + ] + }, + "id": { + "description": "The unique numeric id of this view", + "type": "integer" + }, + "position": { + "description": "The position of this view in the list. The list of all views will be sorted by this parameter.", + "type": "number" + }, + "project_id": { + "description": "The project this view belongs to", + "type": "integer" + }, + "title": { + "description": "The title of this view", + "type": "string" + }, + "updated": { + "description": "A timestamp when this view was updated. You cannot change this value.", + "type": "string" + }, + "view_kind": { + "description": "The kind of this view. Can be `list`, `gantt`, `table` or `kanban`.", + "type": "string", + "enum": [ + "list", + "gantt", + "table", + "kanban" + ] + } + } + }, + "models.ProjectViewBucketConfiguration": { + "type": "object", + "properties": { + "filter": { + "$ref": "#/definitions/models.TaskCollection" + }, + "title": { + "type": "string" + } + } + }, + "models.Reaction": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this reaction was created. You cannot change this value.", + "type": "string" + }, + "user": { + "description": "The user who reacted", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "value": { + "description": "The actual reaction. This can be any valid utf character or text, up to a length of 20.", + "type": "string" + } + } + }, + "models.ReactionMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "models.RelatedTaskMap": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Task" + } + } + }, + "models.RelationKind": { + "type": "string", + "enum": [ + "unknown", + "subtask", + "parenttask", + "related", + "duplicateof", + "duplicates", + "blocking", + "blocked", + "precedes", + "follows", + "copiedfrom", + "copiedto" + ], + "x-enum-varnames": [ + "RelationKindUnknown", + "RelationKindSubtask", + "RelationKindParenttask", + "RelationKindRelated", + "RelationKindDuplicateOf", + "RelationKindDuplicates", + "RelationKindBlocking", + "RelationKindBlocked", + "RelationKindPreceeds", + "RelationKindFollows", + "RelationKindCopiedFrom", + "RelationKindCopiedTo" + ] + }, + "models.ReminderRelation": { + "type": "string", + "enum": [ + "due_date", + "start_date", + "end_date" + ], + "x-enum-varnames": [ + "ReminderRelationDueDate", + "ReminderRelationStartDate", + "ReminderRelationEndDate" + ] + }, + "models.RouteDetail": { + "type": "object", + "properties": { + "method": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "models.SavedFilter": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this filter was created. You cannot change this value.", + "type": "string" + }, + "description": { + "description": "The description of the filter", + "type": "string" + }, + "filters": { + "description": "The actual filters this filter contains", + "allOf": [ + { + "$ref": "#/definitions/models.TaskCollection" + } + ] + }, + "id": { + "description": "The unique numeric id of this saved filter", + "type": "integer" + }, + "is_favorite": { + "description": "True if the filter is a favorite. Favorite filters show up in a separate parent project together with favorite projects.", + "type": "boolean" + }, + "owner": { + "description": "The user who owns this filter", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "title": { + "description": "The title of the filter.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this filter was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.SharingType": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "SharingTypeUnknown", + "SharingTypeWithoutPassword", + "SharingTypeWithPassword" + ] + }, + "models.Subscription": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this subscription was created. You cannot change this value.", + "type": "string" + }, + "entity": { + "type": "integer" + }, + "entity_id": { + "description": "The id of the entity to subscribe to.", + "type": "integer" + }, + "id": { + "description": "The numeric ID of the subscription", + "type": "integer" + } + } + }, + "models.Task": { + "type": "object", + "properties": { + "assignees": { + "description": "An array of users who are assigned to this task", + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + }, + "attachments": { + "description": "All attachments this task has. This property is read-onlym, you must use the separate endpoint to add attachments to a task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskAttachment" + } + }, + "bucket_id": { + "description": "The bucket id. Will only be populated when the task is accessed via a view with buckets.\nCan be used to move a task between buckets. In that case, the new bucket must be in the same view as the old one.", + "type": "integer" + }, + "buckets": { + "description": "All buckets across all views this task is part of. Only present when fetching tasks with the `expand` parameter set to `buckets`.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Bucket" + } + }, + "comment_count": { + "description": "Comment count of this task. Only present when fetching tasks with the `expand` parameter set to `comment_count`.", + "type": "integer" + }, + "comments": { + "description": "All comments of this task. Only present when fetching tasks with the `expand` parameter set to `comments`.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskComment" + } + }, + "cover_image_attachment_id": { + "description": "If this task has a cover image, the field will return the id of the attachment that is the cover image.", + "type": "integer" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the task.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The task description.", + "type": "string" + }, + "done": { + "description": "Whether a task is done or not.", + "type": "boolean" + }, + "done_at": { + "description": "The time when a task was marked as done. This field is system-controlled and cannot be set via API.", + "type": "string" + }, + "due_date": { + "description": "The time when the task is due.", + "type": "string" + }, + "end_date": { + "description": "When this task ends.", + "type": "string" + }, + "hex_color": { + "description": "The task color in hex", + "type": "string", + "maxLength": 7 + }, + "id": { + "description": "The unique, numeric id of this task.", + "type": "integer" + }, + "identifier": { + "description": "The task identifier, based on the project identifier and the task's index", + "type": "string" + }, + "index": { + "description": "The task index, calculated per project", + "type": "integer" + }, + "is_favorite": { + "description": "True if a task is a favorite task. Favorite tasks show up in a separate \"Important\" project. This value depends on the user making the call to the api.", + "type": "boolean" + }, + "is_unread": { + "type": "boolean" + }, + "labels": { + "description": "An array of labels which are associated with this task. This property is read-only, you must use the separate endpoint to add labels to a task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.Label" + } + }, + "percent_done": { + "description": "Determines how far a task is left from being done", + "type": "number" + }, + "position": { + "description": "The position of the task - any task project can be sorted as usual by this parameter.\nWhen accessing tasks via views with buckets, this is primarily used to sort them based on a range.\nPositions are always saved per view. They will automatically be set if you request the tasks through a view\nendpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint.", + "type": "number" + }, + "priority": { + "description": "The task priority. Can be anything you want, it is possible to sort by this later.", + "type": "integer" + }, + "project_id": { + "description": "The project this task belongs to.", + "type": "integer" + }, + "reactions": { + "description": "Reactions on that task.", + "allOf": [ + { + "$ref": "#/definitions/models.ReactionMap" + } + ] + }, + "related_tasks": { + "description": "All related tasks, grouped by their relation kind", + "allOf": [ + { + "$ref": "#/definitions/models.RelatedTaskMap" + } + ] + }, + "reminders": { + "description": "An array of reminders that are associated with this task.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TaskReminder" + } + }, + "repeat_after": { + "description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.", + "type": "integer" + }, + "repeat_mode": { + "description": "Can have three possible values which will trigger when the task is marked as done: 0 = repeats after the amount specified in repeat_after, 1 = repeats all dates each months (ignoring repeat_after), 3 = repeats from the current date rather than the last set date.", + "allOf": [ + { + "$ref": "#/definitions/models.TaskRepeatMode" + } + ] + }, + "start_date": { + "description": "When this task starts.", + "type": "string" + }, + "subscription": { + "description": "The subscription status for the user reading this task. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retrieving one task.", + "allOf": [ + { + "$ref": "#/definitions/models.Subscription" + } + ] + }, + "title": { + "description": "The task text. This is what you'll see in the project.", + "type": "string", + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TaskAssginee": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "models.TaskAttachment": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "created_by": { + "$ref": "#/definitions/user.User" + }, + "file": { + "$ref": "#/definitions/files.File" + }, + "id": { + "type": "integer" + }, + "task_id": { + "type": "integer" + } + } + }, + "models.TaskBucket": { + "type": "object", + "properties": { + "bucket": { + "$ref": "#/definitions/models.Bucket" + }, + "bucket_id": { + "type": "integer" + }, + "project_view_id": { + "description": "The view this bucket belongs to. Combined with TaskID this forms a\nunique index.", + "type": "integer" + }, + "task": { + "$ref": "#/definitions/models.Task" + }, + "task_id": { + "description": "The task which belongs to the bucket. Together with ProjectViewID\nthis field is part of a unique index to prevent duplicates.", + "type": "integer" + } + } + }, + "models.TaskCollection": { + "type": "object", + "properties": { + "filter": { + "description": "The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation.", + "type": "string" + }, + "filter_include_nulls": { + "description": "If set to true, the result will also include null values", + "type": "boolean" + }, + "order_by": { + "description": "The query parameter to order the items by. This can be either asc or desc, with asc being the default.", + "type": "array", + "items": { + "type": "string" + } + }, + "s": { + "type": "string" + }, + "sort_by": { + "description": "The query parameter to sort by. This is for ex. done, priority, etc.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "models.TaskComment": { + "type": "object", + "properties": { + "author": { + "$ref": "#/definitions/user.User" + }, + "comment": { + "type": "string" + }, + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "reactions": { + "$ref": "#/definitions/models.ReactionMap" + }, + "updated": { + "type": "string" + } + } + }, + "models.TaskPosition": { + "type": "object", + "properties": { + "position": { + "description": "The position of the task - any task project can be sorted as usual by this parameter.\nWhen accessing tasks via kanban buckets, this is primarily used to sort them based on a range\nWe're using a float64 here to make it possible to put any task within any two other tasks (by changing the number).\nYou would calculate the new position between two tasks with something like task3.position = (task2.position - task1.position) / 2.\nA 64-Bit float leaves plenty of room to initially give tasks a position with 2^16 difference to the previous task\nwhich also leaves a lot of room for rearranging and sorting later.\nPositions are always saved per view. They will automatically be set if you request the tasks through a view\nendpoint, otherwise they will always be 0. To update them, take a look at the Task Position endpoint.", + "type": "number" + }, + "project_view_id": { + "description": "The project view this task is related to", + "type": "integer" + }, + "task_id": { + "description": "The ID of the task this position is for", + "type": "integer" + } + } + }, + "models.TaskRelation": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this label was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this relation", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "other_task_id": { + "description": "The ID of the other task, the task which is being related.", + "type": "integer" + }, + "relation_kind": { + "description": "The kind of the relation.", + "allOf": [ + { + "$ref": "#/definitions/models.RelationKind" + } + ] + }, + "task_id": { + "description": "The ID of the \"base\" task, the task which has a relation to another.", + "type": "integer" + } + } + }, + "models.TaskReminder": { + "type": "object", + "properties": { + "relative_period": { + "description": "A period in seconds relative to another date argument. Negative values mean the reminder triggers before the date. Default: 0, tiggers when RelativeTo is due.", + "type": "integer" + }, + "relative_to": { + "description": "The name of the date field to which the relative period refers to.", + "allOf": [ + { + "$ref": "#/definitions/models.ReminderRelation" + } + ] + }, + "reminder": { + "description": "The absolute time when the user wants to be reminded of the task.", + "type": "string" + } + } + }, + "models.TaskRepeatMode": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "TaskRepeatModeDefault", + "TaskRepeatModeMonth", + "TaskRepeatModeFromCurrentDate" + ] + }, + "models.TaskUnreadStatus": { + "type": "object", + "properties": { + "taskID": { + "type": "integer" + }, + "userID": { + "type": "integer" + } + } + }, + "models.Team": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this team.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The team's description.", + "type": "string" + }, + "external_id": { + "description": "The team's external id provided by the openid or ldap provider", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this team.", + "type": "integer" + }, + "include_public": { + "description": "Query parameter controlling whether to include public projects or not", + "type": "boolean" + }, + "is_public": { + "description": "Defines wether the team should be publicly discoverable when sharing a project", + "type": "boolean" + }, + "members": { + "description": "An array of all members in this team.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamUser" + } + }, + "name": { + "description": "The name of this team.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TeamMember": { + "type": "object", + "properties": { + "admin": { + "description": "Whether or not the member is an admin of the team. See the docs for more about what a team admin can do", + "type": "boolean" + }, + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this team member relation.", + "type": "integer" + }, + "username": { + "description": "The username of the member. We use this to prevent automated user id entering.", + "type": "string" + } + } + }, + "models.TeamProject": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this project \u003c-\u003e team relation.", + "type": "integer" + }, + "permission": { + "description": "The permission this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", + "default": 0, + "maximum": 2, + "allOf": [ + { + "$ref": "#/definitions/models.Permission" + } + ] + }, + "team_id": { + "description": "The team id.", + "type": "integer" + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.TeamUser": { + "type": "object", + "properties": { + "admin": { + "description": "Whether the member is an admin of the team. See the docs for more about what a team admin can do", + "type": "boolean" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "models.TeamWithPermission": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this relation was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who created this team.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "description": { + "description": "The team's description.", + "type": "string" + }, + "external_id": { + "description": "The team's external id provided by the openid or ldap provider", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this team.", + "type": "integer" + }, + "include_public": { + "description": "Query parameter controlling whether to include public projects or not", + "type": "boolean" + }, + "is_public": { + "description": "Defines wether the team should be publicly discoverable when sharing a project", + "type": "boolean" + }, + "members": { + "description": "An array of all members in this team.", + "type": "array", + "items": { + "$ref": "#/definitions/models.TeamUser" + } + }, + "name": { + "description": "The name of this team.", + "type": "string", + "maxLength": 250, + "minLength": 1 + }, + "permission": { + "$ref": "#/definitions/models.Permission" + }, + "updated": { + "description": "A timestamp when this relation was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "models.UserWithPermission": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "permission": { + "$ref": "#/definitions/models.Permission" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "models.Webhook": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this webhook target was created. You cannot change this value.", + "type": "string" + }, + "created_by": { + "description": "The user who initially created the webhook target.", + "allOf": [ + { + "$ref": "#/definitions/user.User" + } + ] + }, + "events": { + "description": "The webhook events which should fire this webhook target", + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "The generated ID of this webhook target", + "type": "integer" + }, + "project_id": { + "description": "The project ID of the project this webhook target belongs to", + "type": "integer" + }, + "secret": { + "description": "If provided, webhook requests will be signed using HMAC. Check out the docs about how to use this: https://vikunja.io/docs/webhooks/#signing", + "type": "string" + }, + "target_url": { + "description": "The target URL where the POST request with the webhook payload will be made", + "type": "string" + }, + "updated": { + "description": "A timestamp when this webhook target was last updated. You cannot change this value.", + "type": "string" + } + } + }, + "notifications.DatabaseNotification": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this notification was created. You cannot change this value.", + "type": "string" + }, + "id": { + "description": "The unique, numeric id of this notification.", + "type": "integer" + }, + "name": { + "description": "The name of the notification", + "type": "string" + }, + "notification": { + "description": "The actual content of the notification." + }, + "read_at": { + "description": "When this notification is marked as read, this will be updated with the current timestamp.", + "type": "string" + } + } + }, + "openid.Callback": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "redirect_url": { + "type": "string" + }, + "scope": { + "type": "string" + } + } + }, + "todoist.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "trello.Migration": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "user.EmailConfirm": { + "type": "object", + "properties": { + "token": { + "description": "The email confirm token sent via email.", + "type": "string" + } + } + }, + "user.EmailUpdate": { + "type": "object", + "properties": { + "new_email": { + "description": "The new email address. Needs to be a valid email address.", + "type": "string" + }, + "password": { + "description": "The password of the user for confirmation.", + "type": "string" + } + } + }, + "user.Login": { + "type": "object", + "properties": { + "long_token": { + "description": "If true, the token returned will be valid a lot longer than default. Useful for \"remember me\" style logins.", + "type": "boolean" + }, + "password": { + "description": "The password for the user.", + "type": "string" + }, + "totp_passcode": { + "description": "The totp passcode of a user. Only needs to be provided when enabled.", + "type": "string" + }, + "username": { + "description": "The username used to log in.", + "type": "string" + } + } + }, + "user.PasswordReset": { + "type": "object", + "properties": { + "new_password": { + "description": "The new password for this user.", + "type": "string" + }, + "token": { + "description": "The previously issued reset token.", + "type": "string" + } + } + }, + "user.PasswordTokenRequest": { + "type": "object", + "properties": { + "email": { + "type": "string", + "maxLength": 250 + } + } + }, + "user.TOTP": { + "type": "object", + "properties": { + "enabled": { + "description": "The totp entry will only be enabled after the user verified they have a working totp setup.", + "type": "boolean" + }, + "secret": { + "type": "string" + }, + "url": { + "description": "The totp url used to be able to enroll the user later", + "type": "string" + } + } + }, + "user.TOTPPasscode": { + "type": "object", + "properties": { + "passcode": { + "type": "string" + } + } + }, + "user.Token": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "user.User": { + "type": "object", + "properties": { + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "v1.LinkShareAuth": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + } + }, + "v1.UserAvatarProvider": { + "type": "object", + "properties": { + "avatar_provider": { + "description": "The avatar provider. Valid types are `gravatar` (uses the user email), `upload`, `initials`, `marble` (generates a random avatar for each user), `ldap` (synced from LDAP server), `openid` (synced from OpenID provider), `default`.", + "type": "string" + } + } + }, + "v1.UserDeletionRequestConfirm": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "v1.UserExportStatus": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "expires": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "size": { + "type": "integer" + } + } + }, + "v1.UserPassword": { + "type": "object", + "properties": { + "new_password": { + "type": "string" + }, + "old_password": { + "type": "string" + } + } + }, + "v1.UserPasswordConfirmation": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + } + }, + "v1.UserRegister": { + "type": "object", + "properties": { + "email": { + "description": "The user's email address", + "type": "string", + "maxLength": 250 + }, + "language": { + "description": "The language of the new user. Must be a valid IETF BCP 47 language code and exist in Vikunja.", + "type": "string" + }, + "password": { + "description": "The user's password in clear text. Only used when registering the user. The maximum limi is 72 bytes, which may be less than 72 characters. This is due to the limit in the bcrypt hashing algorithm used to store passwords in Vikunja.", + "type": "string", + "maxLength": 72, + "minLength": 8 + }, + "username": { + "description": "The user's username. Cannot contain anything that looks like an url or whitespaces.", + "type": "string", + "maxLength": 250, + "minLength": 3 + } + } + }, + "v1.UserSettings": { + "type": "object", + "properties": { + "default_project_id": { + "description": "If a task is created without a specified project this value should be used. Applies\nto tasks made directly in API and from clients.", + "type": "integer" + }, + "discoverable_by_email": { + "description": "If true, the user can be found when searching for their exact email.", + "type": "boolean" + }, + "discoverable_by_name": { + "description": "If true, this user can be found by their name or parts of it when searching for it.", + "type": "boolean" + }, + "email_reminders_enabled": { + "description": "If enabled, sends email reminders of tasks to the user.", + "type": "boolean" + }, + "extra_settings_links": { + "description": "Additional settings links as provided by openid", + "type": "object", + "additionalProperties": {} + }, + "frontend_settings": { + "description": "Additional settings only used by the frontend" + }, + "language": { + "description": "The user's language", + "type": "string" + }, + "name": { + "description": "The new name of the current user.", + "type": "string" + }, + "overdue_tasks_reminders_enabled": { + "description": "If enabled, the user will get an email for their overdue tasks each morning.", + "type": "boolean" + }, + "overdue_tasks_reminders_time": { + "description": "The time when the daily summary of overdue tasks will be sent via email.", + "type": "string" + }, + "timezone": { + "description": "The user's time zone. Used to send task reminders in the time zone of the user.", + "type": "string" + }, + "week_start": { + "description": "The day when the week starts for this user. 0 = sunday, 1 = monday, etc.", + "type": "integer" + } + } + }, + "v1.UserWithSettings": { + "type": "object", + "properties": { + "auth_provider": { + "type": "string" + }, + "created": { + "description": "A timestamp when this task was created. You cannot change this value.", + "type": "string" + }, + "deletion_scheduled_at": { + "type": "string" + }, + "email": { + "description": "The user's email address.", + "type": "string", + "maxLength": 250 + }, + "id": { + "description": "The unique, numeric id of this user.", + "type": "integer" + }, + "is_local_user": { + "type": "boolean" + }, + "name": { + "description": "The full name of the user.", + "type": "string" + }, + "settings": { + "$ref": "#/definitions/v1.UserSettings" + }, + "updated": { + "description": "A timestamp when this task was last updated. You cannot change this value.", + "type": "string" + }, + "username": { + "description": "The username of the user. Is always unique.", + "type": "string", + "maxLength": 250, + "minLength": 1 + } + } + }, + "v1.authInfo": { + "type": "object", + "properties": { + "ldap": { + "$ref": "#/definitions/v1.ldapAuthInfo" + }, + "local": { + "$ref": "#/definitions/v1.localAuthInfo" + }, + "openid_connect": { + "$ref": "#/definitions/v1.openIDAuthInfo" + } + } + }, + "v1.ldapAuthInfo": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "v1.legalInfo": { + "type": "object", + "properties": { + "imprint_url": { + "type": "string" + }, + "privacy_policy_url": { + "type": "string" + } + } + }, + "v1.localAuthInfo": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "registration_enabled": { + "type": "boolean" + } + } + }, + "v1.openIDAuthInfo": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "providers": { + "type": "array", + "items": { + "$ref": "#/definitions/code_vikunja_io_api_pkg_modules_auth_openid.Provider" + } + } + } + }, + "v1.vikunjaInfos": { + "type": "object", + "properties": { + "auth": { + "$ref": "#/definitions/v1.authInfo" + }, + "available_migrators": { + "type": "array", + "items": { + "type": "string" + } + }, + "caldav_enabled": { + "type": "boolean" + }, + "demo_mode_enabled": { + "type": "boolean" + }, + "email_reminders_enabled": { + "type": "boolean" + }, + "enabled_background_providers": { + "type": "array", + "items": { + "type": "string" + } + }, + "frontend_url": { + "type": "string" + }, + "legal": { + "$ref": "#/definitions/v1.legalInfo" + }, + "link_sharing_enabled": { + "type": "boolean" + }, + "max_file_size": { + "type": "string" + }, + "max_items_per_page": { + "type": "integer" + }, + "motd": { + "type": "string" + }, + "public_teams_enabled": { + "type": "boolean" + }, + "task_attachments_enabled": { + "type": "boolean" + }, + "task_comments_enabled": { + "type": "boolean" + }, + "totp_enabled": { + "type": "boolean" + }, + "user_deletion_enabled": { + "type": "boolean" + }, + "version": { + "type": "string" + }, + "webhooks_enabled": { + "type": "boolean" + } + } + }, + "web.HTTPError": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "BasicAuth": { + "type": "basic" + }, + "JWTKeyAuth": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +} \ No newline at end of file