⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
feat(api,web): fix task access and editor link handling
Andrej710d17517f18
diff --git a/apps/api/src/index.ts b/apps/api/src/index.tsindex a00de25d4..69844d300 100644--- a/apps/api/src/index.ts+++ b/apps/api/src/index.ts@@ -5,7 +5,13 @@ import { migrate } from "drizzle-orm/node-postgres/migrator";import { Hono } from "hono";import { cors } from "hono/cors";import { HTTPException } from "hono/http-exception";-import { openAPIRouteHandler } from "hono-openapi";+import {+ describeRoute,+ openAPIRouteHandler,+ resolver,+ validator,+} from "hono-openapi";+import * as v from "valibot";import activity from "./activity";import { auth } from "./auth";import column from "./column";@@ -132,58 +138,117 @@ const invitationPublicApi = api.get("/invitation/public/:id", async (c) => {return c.json(result);});-api.get("/asset/:id", async (c) => {- const { id } = c.req.param();- const [asset] = await db- .select({- id: schema.assetTable.id,- objectKey: schema.assetTable.objectKey,- mimeType: schema.assetTable.mimeType,- filename: schema.assetTable.filename,- workspaceId: schema.assetTable.workspaceId,- isPublic: schema.projectTable.isPublic,- })- .from(schema.assetTable)- .innerJoin(- schema.projectTable,- eq(schema.assetTable.projectId, schema.projectTable.id),- )- .where(eq(schema.assetTable.id, id))- .limit(1);-- if (!asset) {- throw new HTTPException(404, { message: "Asset not found" });- }+api.get(+ "/auth/get-session",+ describeRoute({+ operationId: "getSession",+ tags: ["Authentication"],+ description: "Get the current authenticated session",+ security: [],+ responses: {+ 200: {+ description: "Current session details or null when unauthenticated",+ content: {+ "application/json": { schema: resolver(v.any()) },+ },+ },+ },+ }),+ async (c) => {+ const session = await auth.api.getSession({ headers: c.req.raw.headers });+ return c.json(session ?? null);+ },+);- const session = await auth.api.getSession({ headers: c.req.raw.headers });- const userId = session?.user?.id || "";+api.get(+ "/asset/:id",+ describeRoute({+ operationId: "getAsset",+ tags: ["Assets"],+ description: "Download an uploaded asset by ID",+ security: [],+ responses: {+ 200: {+ description: "The requested asset binary stream",+ content: {+ "*/*": { schema: resolver(v.any()) },+ },+ },+ },+ }),+ validator("param", v.object({ id: v.string() })),+ async (c) => {+ const { id } = c.req.param();+ const [asset] = await db+ .select({+ id: schema.assetTable.id,+ objectKey: schema.assetTable.objectKey,+ mimeType: schema.assetTable.mimeType,+ filename: schema.assetTable.filename,+ workspaceId: schema.assetTable.workspaceId,+ isPublic: schema.projectTable.isPublic,+ })+ .from(schema.assetTable)+ .innerJoin(+ schema.projectTable,+ eq(schema.assetTable.projectId, schema.projectTable.id),+ )+ .where(eq(schema.assetTable.id, id))+ .limit(1);++ if (!asset) {+ throw new HTTPException(404, { message: "Asset not found" });+ }- if (userId) {- await validateWorkspaceAccess(userId, asset.workspaceId);- } else if (!asset.isPublic) {- throw new HTTPException(401, { message: "Unauthorized" });- }+ const authHeader = c.req.header("Authorization");+ const bearerToken = authHeader?.startsWith("Bearer ")+ ? authHeader.substring(7).replace(/\s+/g, "").trim()+ : null;- try {- const object = await getPrivateObject(asset.objectKey);-- return new Response(object.body as BodyInit, {- headers: {- "Cache-Control": asset.isPublic- ? "public, max-age=300"- : "private, max-age=120",- "Content-Disposition": buildContentDisposition(asset.filename),- "Content-Length": object.contentLength?.toString() || "",- "Content-Type": object.contentType || asset.mimeType,- ETag: object.etag || "",- "Last-Modified": object.lastModified?.toUTCString() || "",- },- });- } catch (error) {- console.error("Failed to stream asset:", error);- throw new HTTPException(404, { message: "Asset object not found" });- }-});+ let userId = "";+ let apiKeyId: string | undefined;++ if (bearerToken) {+ const result = await verifyApiKey(bearerToken);++ if (result?.valid && result.key) {+ userId = result.key.userId;+ apiKeyId = result.key.id;+ } else {+ throw new HTTPException(401, { message: "Invalid API key" });+ }+ } else {+ const session = await auth.api.getSession({ headers: c.req.raw.headers });+ userId = session?.user?.id || "";+ }++ if (userId) {+ await validateWorkspaceAccess(userId, asset.workspaceId, apiKeyId);+ } else if (!asset.isPublic) {+ throw new HTTPException(401, { message: "Unauthorized" });+ }++ try {+ const object = await getPrivateObject(asset.objectKey);++ return new Response(object.body as BodyInit, {+ headers: {+ "Cache-Control": asset.isPublic+ ? "public, max-age=300"+ : "private, max-age=120",+ "Content-Disposition": buildContentDisposition(asset.filename),+ "Content-Length": object.contentLength?.toString() || "",+ "Content-Type": object.contentType || asset.mimeType,+ ETag: object.etag || "",+ "Last-Modified": object.lastModified?.toUTCString() || "",+ },+ });+ } catch (error) {+ console.error("Failed to stream asset:", error);+ throw new HTTPException(404, { message: "Asset object not found" });+ }+ },+);const configApi = api.route("/config", config);diff --git a/apps/api/src/label/controllers/assign-label-to-task.ts b/apps/api/src/label/controllers/assign-label-to-task.tsnew file mode 100644index 000000000..cd008f97c--- /dev/null+++ b/apps/api/src/label/controllers/assign-label-to-task.ts@@ -0,0 +1,70 @@+import { eq } from "drizzle-orm";+import { HTTPException } from "hono/http-exception";+import db from "../../database";+import { labelTable, projectTable, taskTable } from "../../database/schema";+import {+ removeLabelFromGitHub,+ syncLabelToGitHub,+} from "../../plugins/github/utils/sync-label-to-github";++async function assignLabelToTask(id: string, taskId: string) {+ const label = await db.query.labelTable.findFirst({+ where: (label, { eq }) => eq(label.id, id),+ });++ if (!label) {+ throw new HTTPException(404, {+ message: "Label not found",+ });+ }++ const [task] = await db+ .select({+ id: taskTable.id,+ workspaceId: projectTable.workspaceId,+ })+ .from(taskTable)+ .innerJoin(projectTable, eq(taskTable.projectId, projectTable.id))+ .where(eq(taskTable.id, taskId))+ .limit(1);++ if (!task) {+ throw new HTTPException(404, {+ message: "Task not found",+ });+ }++ if (label.workspaceId && label.workspaceId !== task.workspaceId) {+ throw new HTTPException(400, {+ message: "Label and task must belong to the same workspace",+ });+ }++ const [updatedLabel] = await db+ .update(labelTable)+ .set({ taskId })+ .where(eq(labelTable.id, id))+ .returning();++ if (!updatedLabel) {+ throw new HTTPException(500, {+ message: "Failed to attach label to task",+ });+ }++ if (label.taskId && label.taskId !== taskId) {+ removeLabelFromGitHub(label.taskId, label.name).catch((error) => {+ console.error("Failed to remove label from GitHub:", error);+ });+ }++ syncLabelToGitHub(taskId, updatedLabel.name, updatedLabel.color).catch(+ (error) => {+ console.error("Failed to sync label to GitHub:", error);+ },+ );++ return updatedLabel;+}++export default assignLabelToTask;diff --git a/apps/api/src/label/controllers/unassign-label-from-task.ts b/apps/api/src/label/controllers/unassign-label-from-task.tsnew file mode 100644index 000000000..eb73313e5--- /dev/null+++ b/apps/api/src/label/controllers/unassign-label-from-task.ts@@ -0,0 +1,39 @@+import { eq } from "drizzle-orm";+import { HTTPException } from "hono/http-exception";+import db from "../../database";+import { labelTable } from "../../database/schema";+import { removeLabelFromGitHub } from "../../plugins/github/utils/sync-label-to-github";++async function unassignLabelFromTask(id: string) {+ const label = await db.query.labelTable.findFirst({+ where: (label, { eq }) => eq(label.id, id),+ });++ if (!label) {+ throw new HTTPException(404, {+ message: "Label not found",+ });+ }++ const [updatedLabel] = await db+ .update(labelTable)+ .set({ taskId: null })+ .where(eq(labelTable.id, id))+ .returning();++ if (!updatedLabel) {+ throw new HTTPException(500, {+ message: "Failed to detach label from task",+ });+ }++ if (label.taskId) {+ removeLabelFromGitHub(label.taskId, label.name).catch((error) => {+ console.error("Failed to remove label from GitHub:", error);+ });+ }++ return updatedLabel;+}++export default unassignLabelFromTask;diff --git a/apps/api/src/label/index.ts b/apps/api/src/label/index.tsindex a39042214..c100ef838 100644--- a/apps/api/src/label/index.ts+++ b/apps/api/src/label/index.ts@@ -3,11 +3,13 @@ import { describeRoute, resolver, validator } from "hono-openapi";import * as v from "valibot";import { labelSchema } from "../schemas";import { workspaceAccess } from "../utils/workspace-access-middleware";+import assignLabelToTask from "./controllers/assign-label-to-task";import createLabel from "./controllers/create-label";import deleteLabel from "./controllers/delete-label";import getLabel from "./controllers/get-label";import getLabelsByTaskId from "./controllers/get-labels-by-task-id";import getLabelsByWorkspaceId from "./controllers/get-labels-by-workspace-id";+import unassignLabelFromTask from "./controllers/unassign-label-from-task";import updateLabel from "./controllers/update-label";const label = new Hono()@@ -111,6 +113,54 @@ const label = new Hono()return c.json(label);},)+ .put(+ "/:id/task",+ describeRoute({+ operationId: "attachLabelToTask",+ tags: ["Labels"],+ description: "Attach an existing label to a task",+ responses: {+ 200: {+ description: "Label attached to task successfully",+ content: {+ "application/json": { schema: resolver(labelSchema) },+ },+ },+ },+ }),+ validator("param", v.object({ id: v.string() })),+ validator("json", v.object({ taskId: v.string() })),+ workspaceAccess.fromLabel(),+ async (c) => {+ const { id } = c.req.valid("param");+ const { taskId } = c.req.valid("json");+ const label = await assignLabelToTask(id, taskId);+ return c.json(label);+ },+ )+ .delete(+ "/:id/task",+ describeRoute({+ operationId: "detachLabelFromTask",+ tags: ["Labels"],+ description: "Detach a label from its current task",+ responses: {+ 200: {+ description: "Label detached from task successfully",+ content: {+ "application/json": { schema: resolver(labelSchema) },+ },+ },+ },+ }),+ validator("param", v.object({ id: v.string() })),+ workspaceAccess.fromLabel(),+ async (c) => {+ const { id } = c.req.valid("param");+ const label = await unassignLabelFromTask(id);+ return c.json(label);+ },+ ).put("/:id",describeRoute({diff --git a/apps/api/src/project/controllers/delete-project.ts b/apps/api/src/project/controllers/delete-project.tsindex 3e5df1ee6..701730fd1 100644--- a/apps/api/src/project/controllers/delete-project.ts+++ b/apps/api/src/project/controllers/delete-project.ts@@ -1,31 +1,24 @@-import { and, eq } from "drizzle-orm";+import { eq } from "drizzle-orm";import { HTTPException } from "hono/http-exception";import db from "../../database";import { projectTable } from "../../database/schema";+import getProject from "./get-project";async function deleteProject(id: string, workspaceId: string) {- const [existingProject] = await db- .select()- .from(projectTable)- .where(- and(eq(projectTable.id, id), eq(projectTable.workspaceId, workspaceId)),- );-- const isProjectExisting = Boolean(existingProject);-- if (!isProjectExisting) {- throw new HTTPException(404, {- message:- "Project doesn't exist or doesn't belong to the specified workspace",- });- }+ const existingProject = await getProject(id, workspaceId);const [deletedProject] = await db.delete(projectTable).where(eq(projectTable.id, id)).returning();- return deletedProject;+ if (!deletedProject) {+ throw new HTTPException(500, {+ message: "Failed to delete project",+ });+ }++ return existingProject;}export default deleteProject;diff --git a/apps/api/src/project/index.ts b/apps/api/src/project/index.tsindex 16a0ec37b..72df229d3 100644--- a/apps/api/src/project/index.ts+++ b/apps/api/src/project/index.ts@@ -86,7 +86,6 @@ const project = new Hono<{},}),validator("param", v.object({ id: v.string() })),- validator("query", v.optional(v.object({ workspaceId: v.string() }))),workspaceAccess.fromProject(),async (c) => {const { id } = c.req.valid("param");diff --git a/apps/api/src/task/controllers/delete-task.ts b/apps/api/src/task/controllers/delete-task.tsindex c56190e90..82d0c9bda 100644--- a/apps/api/src/task/controllers/delete-task.ts+++ b/apps/api/src/task/controllers/delete-task.ts@@ -2,15 +2,18 @@ import { eq } from "drizzle-orm";import { HTTPException } from "hono/http-exception";import db from "../../database";import { taskTable } from "../../database/schema";+import getTask from "./get-task";async function deleteTask(taskId: string) {- const task = await db+ const task = await getTask(taskId);++ const [deletedTask] = await db.delete(taskTable).where(eq(taskTable.id, taskId)).returning().execute();- if (!task) {+ if (!deletedTask) {throw new HTTPException(404, {message: "Task not found",});diff --git a/apps/api/src/task/controllers/get-tasks.ts b/apps/api/src/task/controllers/get-tasks.tsindex bfc42949b..44218ae76 100644--- a/apps/api/src/task/controllers/get-tasks.ts+++ b/apps/api/src/task/controllers/get-tasks.ts@@ -1,4 +1,4 @@-import { asc, eq, inArray } from "drizzle-orm";+import { and, asc, eq, inArray, sql } from "drizzle-orm";import { HTTPException } from "hono/http-exception";import db from "../../database";import {@@ -10,7 +10,15 @@ import {userTable,} from "../../database/schema";-async function getTasks(projectId: string) {+type GetTasksOptions = {+ assigneeId?: string;+ limit?: number;+ page?: number;+ priority?: string;+ status?: string;+};++async function getTasks(projectId: string, options: GetTasksOptions = {}) {const project = await db.query.projectTable.findFirst({where: eq(projectTable.id, projectId),});@@ -21,30 +29,67 @@ async function getTasks(projectId: string) {});}- const tasks = await db- .select({- id: taskTable.id,- title: taskTable.title,- number: taskTable.number,- description: taskTable.description,- status: taskTable.status,- priority: taskTable.priority,- dueDate: taskTable.dueDate,- position: taskTable.position,- createdAt: taskTable.createdAt,- userId: taskTable.userId,- assigneeName: userTable.name,- assigneeId: userTable.id,- assigneeImage: userTable.image,- projectId: taskTable.projectId,- })+ const conditions = [eq(taskTable.projectId, projectId)];++ if (options.status) {+ conditions.push(eq(taskTable.status, options.status));+ }++ if (options.priority) {+ conditions.push(eq(taskTable.priority, options.priority));+ }++ if (options.assigneeId) {+ conditions.push(eq(taskTable.userId, options.assigneeId));+ }++ const whereClause = and(...conditions);+ const page = options.page && options.page > 0 ? options.page : 1;+ const limit =+ options.limit && options.limit > 0 ? Math.min(options.limit, 100) : null;+ const offset = limit ? (page - 1) * limit : 0;++ const [taskCount] = await db+ .select({ count: sql<number>`count(*)` }).from(taskTable)- .leftJoin(userTable, eq(taskTable.userId, userTable.id))- .leftJoin(projectTable, eq(taskTable.projectId, projectTable.id))- .where(eq(taskTable.projectId, projectId))- .orderBy(taskTable.position);+ .where(whereClause);++ const taskSelection = {+ id: taskTable.id,+ title: taskTable.title,+ number: taskTable.number,+ description: taskTable.description,+ status: taskTable.status,+ priority: taskTable.priority,+ dueDate: taskTable.dueDate,+ position: taskTable.position,+ createdAt: taskTable.createdAt,+ userId: taskTable.userId,+ assigneeName: userTable.name,+ assigneeId: userTable.id,+ assigneeImage: userTable.image,+ projectId: taskTable.projectId,+ };++ const paginatedTasks = limit+ ? await db+ .select(taskSelection)+ .from(taskTable)+ .leftJoin(userTable, eq(taskTable.userId, userTable.id))+ .leftJoin(projectTable, eq(taskTable.projectId, projectTable.id))+ .where(whereClause)+ .orderBy(taskTable.position)+ .limit(limit)+ .offset(offset)+ : await db+ .select(taskSelection)+ .from(taskTable)+ .leftJoin(userTable, eq(taskTable.userId, userTable.id))+ .leftJoin(projectTable, eq(taskTable.projectId, projectTable.id))+ .where(whereClause)+ .orderBy(taskTable.position);- const taskIds = tasks.map((task) => task.id);+ const taskIds = paginatedTasks.map((task) => task.id);const labelsData =taskIds.length > 0@@ -119,7 +164,7 @@ async function getTasks(projectId: string) {id: column.slug,name: column.name,isFinal: column.isFinal,- tasks: tasks+ tasks: paginatedTasks.filter((task) => task.status === column.slug).map((task) => ({...task,@@ -128,7 +173,7 @@ async function getTasks(projectId: string) {})),}));- const archivedTasks = tasks+ const archivedTasks = paginatedTasks.filter((task) => task.status === "archived").map((task) => ({...task,@@ -136,7 +181,7 @@ async function getTasks(projectId: string) {externalLinks: taskExternalLinksMap.get(task.id) || [],}));- const plannedTasks = tasks+ const plannedTasks = paginatedTasks.filter((task) => task.status === "planned").map((task) => ({...task,@@ -155,6 +200,16 @@ async function getTasks(projectId: string) {columns,archivedTasks,plannedTasks,+ pagination: limit+ ? {+ page,+ limit,+ total: taskCount?.count ?? 0,+ totalPages: Math.max(1, Math.ceil((taskCount?.count ?? 0) / limit)),+ hasNextPage: offset + paginatedTasks.length < (taskCount?.count ?? 0),+ hasPreviousPage: page > 1,+ }+ : undefined,};}diff --git a/apps/api/src/task/controllers/update-task-assignee.ts b/apps/api/src/task/controllers/update-task-assignee.tsindex fad7adb5d..7486c5c9a 100644--- a/apps/api/src/task/controllers/update-task-assignee.ts+++ b/apps/api/src/task/controllers/update-task-assignee.ts@@ -10,24 +10,25 @@ async function updateTaskAssignee({id: string;userId: string;}) {- const updatedTask = await db.query.taskTable.findFirst({+ const existingTask = await db.query.taskTable.findFirst({where: eq(taskTable.id, id),});- if (!updatedTask) {+ if (!existingTask) {throw new HTTPException(404, {message: "Task not found",});}- await db+ const [updatedTask] = await db.update(taskTable).set({ userId: userId || null })- .where(eq(taskTable.id, id));+ .where(eq(taskTable.id, id))+ .returning();if (!updatedTask) {- throw new HTTPException(404, {- message: "Task not found",+ throw new HTTPException(500, {+ message: "Failed to update task assignee",});}diff --git a/apps/api/src/task/controllers/update-task-due-date.ts b/apps/api/src/task/controllers/update-task-due-date.tsindex 667a7ac0c..830f649a1 100644--- a/apps/api/src/task/controllers/update-task-due-date.ts+++ b/apps/api/src/task/controllers/update-task-due-date.ts@@ -10,24 +10,25 @@ async function updateTaskDueDate({id: string;dueDate: Date | null;}) {- const updatedTask = await db.query.taskTable.findFirst({+ const existingTask = await db.query.taskTable.findFirst({where: eq(taskTable.id, id),});- if (!updatedTask) {+ if (!existingTask) {throw new HTTPException(404, {message: "Task not found",});}- await db+ const [updatedTask] = await db.update(taskTable).set({ dueDate: dueDate || null })- .where(eq(taskTable.id, id));+ .where(eq(taskTable.id, id))+ .returning();if (!updatedTask) {- throw new HTTPException(404, {- message: "Task not found",+ throw new HTTPException(500, {+ message: "Failed to update task due date",});}diff --git a/apps/api/src/task/controllers/update-task-priority.ts b/apps/api/src/task/controllers/update-task-priority.tsindex 66c0787d6..1f9fba445 100644--- a/apps/api/src/task/controllers/update-task-priority.ts+++ b/apps/api/src/task/controllers/update-task-priority.ts@@ -10,21 +10,25 @@ async function updateTaskPriority({id: string;priority: string;}) {- const updatedTask = await db.query.taskTable.findFirst({+ const existingTask = await db.query.taskTable.findFirst({where: eq(taskTable.id, id),});- if (!updatedTask) {+ if (!existingTask) {throw new HTTPException(404, {message: "Task not found",});}- await db.update(taskTable).set({ priority }).where(eq(taskTable.id, id));+ const [updatedTask] = await db+ .update(taskTable)+ .set({ priority })+ .where(eq(taskTable.id, id))+ .returning();if (!updatedTask) {- throw new HTTPException(404, {- message: "Task not found",+ throw new HTTPException(500, {+ message: "Failed to update task priority",});}diff --git a/apps/api/src/task/controllers/update-task-status.ts b/apps/api/src/task/controllers/update-task-status.tsindex 2dfc99539..2281a8492 100644--- a/apps/api/src/task/controllers/update-task-status.ts+++ b/apps/api/src/task/controllers/update-task-status.ts@@ -10,11 +10,11 @@ async function updateTaskStatus({id: string;status: string;}) {- const updatedTask = await db.query.taskTable.findFirst({+ const existingTask = await db.query.taskTable.findFirst({where: eq(taskTable.id, id),});- if (!updatedTask) {+ if (!existingTask) {throw new HTTPException(404, {message: "Task not found",});@@ -22,15 +22,22 @@ async function updateTaskStatus({const column = await db.query.columnTable.findFirst({where: and(- eq(columnTable.projectId, updatedTask.projectId),+ eq(columnTable.projectId, existingTask.projectId),eq(columnTable.slug, status),),});- await db+ const [updatedTask] = await db.update(taskTable).set({ status, columnId: column?.id ?? null })- .where(eq(taskTable.id, id));+ .where(eq(taskTable.id, id))+ .returning();++ if (!updatedTask) {+ throw new HTTPException(500, {+ message: "Failed to update task status",+ });+ }return updatedTask;}diff --git a/apps/api/src/task/controllers/update-task.ts b/apps/api/src/task/controllers/update-task.tsindex 2f97c2038..3451e5ca4 100644--- a/apps/api/src/task/controllers/update-task.ts+++ b/apps/api/src/task/controllers/update-task.ts@@ -53,7 +53,7 @@ async function updateTask(});}- return existingTask;+ return updatedTask;}export default updateTask;diff --git a/apps/api/src/task/index.ts b/apps/api/src/task/index.tsindex 74e5e65f4..f1c8ad246 100644--- a/apps/api/src/task/index.ts+++ b/apps/api/src/task/index.ts@@ -56,11 +56,24 @@ const task = new Hono<{},}),validator("param", v.object({ projectId: v.string() })),+ validator(+ "query",+ v.optional(+ v.object({+ status: v.optional(v.string()),+ priority: v.optional(v.string()),+ assigneeId: v.optional(v.string()),+ page: v.optional(v.pipe(v.string(), v.transform(Number))),+ limit: v.optional(v.pipe(v.string(), v.transform(Number))),+ }),+ ),+ ),workspaceAccess.fromProject("projectId"),async (c) => {const { projectId } = c.req.valid("param");+ const filters = c.req.valid("query") || {};- const tasks = await getTasks(projectId);+ const tasks = await getTasks(projectId, filters);return c.json(tasks);},@@ -167,6 +180,9 @@ const task = new Hono<{workspaceAccess.fromTask(),async (c) => {const { id } = c.req.valid("param");+ const existingTask = await db.query.taskTable.findFirst({+ where: eq(taskTable.id, id),+ });const {title,description,@@ -178,6 +194,10 @@ const task = new Hono<{userId,} = c.req.valid("json");+ if (!existingTask) {+ throw new HTTPException(404, { message: "Task not found" });+ }+const task = await updateTask(id,title,@@ -190,13 +210,13 @@ const task = new Hono<{userId,);- if (status !== task.status) {+ if (existingTask.status !== status) {const user = c.get("userId");await publishEvent("task.status_changed", {taskId: task.id,projectId: task.projectId,userId: user,- oldStatus: task.status,+ oldStatus: existingTask.status,newStatus: status,title: task.title,assigneeId: task.userId,@@ -320,6 +340,13 @@ const task = new Hono<{const { id } = c.req.valid("param");const { status } = c.req.valid("json");const user = c.get("userId");+ const existingTask = await db.query.taskTable.findFirst({+ where: eq(taskTable.id, id),+ });++ if (!existingTask) {+ throw new HTTPException(404, { message: "Task not found" });+ }const task = await updateTaskStatus({ id, status });@@ -327,7 +354,7 @@ const task = new Hono<{taskId: task.id,projectId: task.projectId,userId: user,- oldStatus: task.status,+ oldStatus: existingTask.status,newStatus: status,title: task.title,assigneeId: task.userId,@@ -359,6 +386,13 @@ const task = new Hono<{const { id } = c.req.valid("param");const { priority } = c.req.valid("json");const user = c.get("userId");+ const existingTask = await db.query.taskTable.findFirst({+ where: eq(taskTable.id, id),+ });++ if (!existingTask) {+ throw new HTTPException(404, { message: "Task not found" });+ }const task = await updateTaskPriority({ id, priority });@@ -366,7 +400,7 @@ const task = new Hono<{taskId: task.id,projectId: task.projectId,userId: user,- oldPriority: task.priority,+ oldPriority: existingTask.priority,newPriority: priority,title: task.title,type: "priority_changed",@@ -397,6 +431,13 @@ const task = new Hono<{const { id } = c.req.valid("param");const { userId } = c.req.valid("json");const user = c.get("userId");+ const existingTask = await db.query.taskTable.findFirst({+ where: eq(taskTable.id, id),+ });++ if (!existingTask) {+ throw new HTTPException(404, { message: "Task not found" });+ }const task = await updateTaskAssignee({ id, userId });const newAssigneeName = userId@@ -422,7 +463,7 @@ const task = new Hono<{await publishEvent("task.assignee_changed", {taskId: task.id,userId: user,- oldAssignee: task.userId,+ oldAssignee: existingTask.userId,newAssignee: newAssigneeName,newAssigneeId: userId,title: task.title,@@ -454,6 +495,13 @@ const task = new Hono<{const { id } = c.req.valid("param");const { dueDate = null } = c.req.valid("json");const user = c.get("userId");+ const existingTask = await db.query.taskTable.findFirst({+ where: eq(taskTable.id, id),+ });++ if (!existingTask) {+ throw new HTTPException(404, { message: "Task not found" });+ }const task = await updateTaskDueDate({id,@@ -463,7 +511,7 @@ const task = new Hono<{await publishEvent("task.due_date_changed", {taskId: task.id,userId: user,- oldDueDate: task.dueDate,+ oldDueDate: existingTask.dueDate,newDueDate: dueDate,title: task.title,type: "due_date_changed",diff --git a/apps/api/src/utils/workspace-access-middleware.ts b/apps/api/src/utils/workspace-access-middleware.tsindex 9b0b67986..85716c958 100644--- a/apps/api/src/utils/workspace-access-middleware.ts+++ b/apps/api/src/utils/workspace-access-middleware.ts@@ -221,36 +221,57 @@ export const workspaceAccess = {fromTask: (idKey = "id") =>workspaceAccessMiddleware({- sources: [{ type: "lookup", resource: "task", idKey }],+ sources: [+ { type: "lookup", resource: "task", idKey },+ { type: "query", key: "workspaceId" },+ ],}),fromTaskId: (idKey = "taskId") =>workspaceAccessMiddleware({- sources: [{ type: "lookup", resource: "task", idKey }],+ sources: [+ { type: "lookup", resource: "task", idKey },+ { type: "query", key: "workspaceId" },+ ],}),fromLabel: (idKey = "id") =>workspaceAccessMiddleware({- sources: [{ type: "lookup", resource: "label", idKey }],+ sources: [+ { type: "lookup", resource: "label", idKey },+ { type: "query", key: "workspaceId" },+ ],}),fromTimeEntry: (idKey = "id") =>workspaceAccessMiddleware({- sources: [{ type: "lookup", resource: "timeEntry", idKey }],+ sources: [+ { type: "lookup", resource: "timeEntry", idKey },+ { type: "query", key: "workspaceId" },+ ],}),fromActivity: (idKey = "id") =>workspaceAccessMiddleware({- sources: [{ type: "lookup", resource: "activity", idKey }],+ sources: [+ { type: "lookup", resource: "activity", idKey },+ { type: "query", key: "workspaceId" },+ ],}),fromColumn: (idKey = "id") =>workspaceAccessMiddleware({- sources: [{ type: "lookup", resource: "column", idKey }],+ sources: [+ { type: "lookup", resource: "column", idKey },+ { type: "query", key: "workspaceId" },+ ],}),fromWorkflowRule: (idKey = "id") =>workspaceAccessMiddleware({- sources: [{ type: "lookup", resource: "workflowRule", idKey }],+ sources: [+ { type: "lookup", resource: "workflowRule", idKey },+ { type: "query", key: "workspaceId" },+ ],}),};diff --git a/apps/docs/core/functional/backlog-planning.mdx b/apps/docs/core/functional/backlog-planning.mdxindex e9acdcfa7..e307c5b74 100644--- a/apps/docs/core/functional/backlog-planning.mdx+++ b/apps/docs/core/functional/backlog-planning.mdx@@ -5,6 +5,8 @@ description: Use the backlog to prepare work before it enters active executionBacklog view is your planning layer. Use it to prepare tasks before moving them into active columns.+In Kaneo's data model, backlog items use the `planned` task status. A board column named "Backlog" is just a regular board column, not the same thing as the Backlog view.+## When to use BacklogUse backlog when you need to:diff --git a/apps/docs/docs.json b/apps/docs/docs.jsonindex e73f69955..e33144703 100644--- a/apps/docs/docs.json+++ b/apps/docs/docs.json@@ -100,7 +100,7 @@},{"tab": "API Reference",- "openapi": "./openapi.json"+ "openapi": "https://cloud.kaneo.app/api/openapi"}],"global": {diff --git a/apps/docs/openapi.json b/apps/docs/openapi.jsondeleted file mode 100644index d9cf8d642..000000000--- a/apps/docs/openapi.json+++ /dev/null@@ -1,9265 +0,0 @@-{- "openapi": "3.0.3",- "info": {- "title": "Kaneo API",- "description": "Kaneo Project Management API - Manage projects, tasks, labels, and more",- "version": "1.0.0"- },- "servers": [- {- "url": "https://cloud.kaneo.app/api",- "description": "Kaneo API Server"- }- ],- "components": {- "securitySchemes": {- "bearerAuth": {- "type": "http",- "scheme": "bearer",- "description": "Bearer token authentication"- },- "apiKeyCookie": {- "type": "apiKey",- "in": "cookie",- "name": "apiKeyCookie",- "description": "API Key authentication via cookie"- }- },- "schemas": {- "Organization": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "slug": {- "type": "string"- },- "logo": {- "type": "string"- },- "createdAt": {- "type": "string",- "format": "date-time"- },- "metadata": {- "type": "string"- },- "description": {- "type": "string"- }- },- "required": [- "name",- "slug",- "createdAt"- ]- },- "Team": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "organizationId": {- "type": "string"- },- "createdAt": {- "type": "string",- "format": "date-time"- },- "updatedAt": {- "type": "string",- "format": "date-time"- }- },- "required": [- "name",- "organizationId",- "createdAt"- ]- }- }- },- "security": [- {- "bearerAuth": []- }- ],- "paths": {- "/config": {- "get": {- "operationId": "getConfig",- "tags": [- "Config"- ],- "description": "Get application settings and configuration",- "responses": {- "200": {- "description": "Application settings",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "disableRegistration": {- "type": "boolean",- "nullable": true- },- "isDemoMode": {- "type": "boolean"- },- "hasSmtp": {- "type": "boolean"- },- "hasGithubSignIn": {- "type": "boolean",- "nullable": true- },- "hasGoogleSignIn": {- "type": "boolean",- "nullable": true- },- "hasDiscordSignIn": {- "type": "boolean",- "nullable": true- },- "hasCustomOAuth": {- "type": "boolean",- "nullable": true- },- "hasGuestAccess": {- "type": "boolean",- "nullable": true- }- },- "required": [- "disableRegistration",- "isDemoMode",- "hasSmtp",- "hasGithubSignIn",- "hasGoogleSignIn",- "hasDiscordSignIn",- "hasCustomOAuth",- "hasGuestAccess"- ]- }- }- }- }- },- "summary": "Get Config"- }- },- "/project": {- "get": {- "operationId": "listProjects",- "tags": [- "Projects"- ],- "description": "Get all projects in a workspace",- "responses": {- "200": {- "description": "List of projects with statistics",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "slug": {- "type": "string"- },- "icon": {- "type": "string",- "nullable": true- },- "name": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "createdAt": {},- "isPublic": {- "type": "boolean",- "nullable": true- }- },- "required": [- "id",- "workspaceId",- "slug",- "icon",- "name",- "description",- "createdAt",- "isPublic"- ]- }- }- }- }- }- },- "parameters": [- {- "in": "query",- "name": "workspaceId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "List Projects"- },- "post": {- "operationId": "createProject",- "tags": [- "Projects"- ],- "description": "Create a new project in a workspace",- "responses": {- "200": {- "description": "Project created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "slug": {- "type": "string"- },- "icon": {- "type": "string",- "nullable": true- },- "name": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "createdAt": {},- "isPublic": {- "type": "boolean",- "nullable": true- }- },- "required": [- "id",- "workspaceId",- "slug",- "icon",- "name",- "description",- "createdAt",- "isPublic"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "icon": {- "type": "string"- },- "slug": {- "type": "string"- }- },- "required": [- "name",- "workspaceId",- "icon",- "slug"- ]- }- }- }- },- "summary": "Create Project"- }- },- "/project/{id}": {- "get": {- "operationId": "getProject",- "tags": [- "Projects"- ],- "description": "Get a specific project by ID",- "responses": {- "200": {- "description": "Project details",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "slug": {- "type": "string"- },- "icon": {- "type": "string",- "nullable": true- },- "name": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "createdAt": {},- "isPublic": {- "type": "boolean",- "nullable": true- }- },- "required": [- "id",- "workspaceId",- "slug",- "icon",- "name",- "description",- "createdAt",- "isPublic"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- },- {- "in": "query",- "name": "workspaceId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Project"- },- "put": {- "operationId": "updateProject",- "tags": [- "Projects"- ],- "description": "Update an existing project",- "responses": {- "200": {- "description": "Project updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "slug": {- "type": "string"- },- "icon": {- "type": "string",- "nullable": true- },- "name": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "createdAt": {},- "isPublic": {- "type": "boolean",- "nullable": true- }- },- "required": [- "id",- "workspaceId",- "slug",- "icon",- "name",- "description",- "createdAt",- "isPublic"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "icon": {- "type": "string"- },- "slug": {- "type": "string"- },- "description": {- "type": "string"- },- "isPublic": {- "type": "boolean"- }- },- "required": [- "name",- "icon",- "slug",- "description",- "isPublic"- ]- }- }- }- },- "summary": "Update Project"- },- "delete": {- "operationId": "deleteProject",- "tags": [- "Projects"- ],- "description": "Delete a project by ID",- "responses": {- "200": {- "description": "Project deleted successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "slug": {- "type": "string"- },- "icon": {- "type": "string",- "nullable": true- },- "name": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "createdAt": {},- "isPublic": {- "type": "boolean",- "nullable": true- }- },- "required": [- "id",- "workspaceId",- "slug",- "icon",- "name",- "description",- "createdAt",- "isPublic"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Delete Project"- }- },- "/task/tasks/{projectId}": {- "get": {- "operationId": "listTasks",- "tags": [- "Tasks"- ],- "description": "Get all tasks for a specific project",- "responses": {- "200": {- "description": "Project with tasks organized by columns",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "List Tasks"- }- },- "/task/{projectId}": {- "post": {- "operationId": "createTask",- "tags": [- "Tasks"- ],- "description": "Create a new task in a project",- "responses": {- "200": {- "description": "Task created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "title": {- "type": "string"- },- "description": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "priority": {- "type": "string"- },- "status": {- "type": "string"- },- "userId": {- "type": "string"- }- },- "required": [- "title",- "description",- "priority",- "status"- ]- }- }- }- },- "parameters": [- {- "schema": {- "type": "string"- },- "in": "path",- "name": "projectId",- "required": true- }- ],- "summary": "Create Task"- }- },- "/task/{id}": {- "get": {- "operationId": "getTask",- "tags": [- "Tasks"- ],- "description": "Get a specific task by ID",- "responses": {- "200": {- "description": "Task details",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Task"- },- "put": {- "operationId": "updateTask",- "tags": [- "Tasks"- ],- "description": "Update all fields of a task",- "responses": {- "200": {- "description": "Task updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "title": {- "type": "string"- },- "description": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "priority": {- "type": "string"- },- "status": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number"- },- "userId": {- "type": "string"- }- },- "required": [- "title",- "description",- "priority",- "status",- "projectId",- "position"- ]- }- }- }- },- "summary": "Update Task"- },- "delete": {- "operationId": "deleteTask",- "tags": [- "Tasks"- ],- "description": "Delete a task by ID",- "responses": {- "200": {- "description": "Task deleted successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Delete Task"- }- },- "/task/export/{projectId}": {- "get": {- "operationId": "exportTasks",- "tags": [- "Tasks"- ],- "description": "Export all tasks from a project",- "responses": {- "200": {- "description": "Exported tasks data",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Export Tasks"- }- },- "/task/import/{projectId}": {- "post": {- "operationId": "importTasks",- "tags": [- "Tasks"- ],- "description": "Import multiple tasks into a project",- "responses": {- "200": {- "description": "Tasks imported successfully",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "tasks": {- "type": "array",- "items": {- "type": "object",- "properties": {- "title": {- "type": "string"- },- "description": {- "type": "string"- },- "status": {- "type": "string"- },- "priority": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "userId": {- "type": "string",- "nullable": true- }- },- "required": [- "title",- "status"- ]- }- }- },- "required": [- "tasks"- ]- }- }- }- },- "summary": "Import Tasks"- }- },- "/task/status/{id}": {- "put": {- "operationId": "updateTaskStatus",- "tags": [- "Tasks"- ],- "description": "Update only the status of a task",- "responses": {- "200": {- "description": "Task status updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "status": {- "type": "string"- }- },- "required": [- "status"- ]- }- }- }- },- "summary": "Update Task Status"- }- },- "/task/priority/{id}": {- "put": {- "operationId": "updateTaskPriority",- "tags": [- "Tasks"- ],- "description": "Update only the priority of a task",- "responses": {- "200": {- "description": "Task priority updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "priority": {- "type": "string"- }- },- "required": [- "priority"- ]- }- }- }- },- "summary": "Update Task Priority"- }- },- "/task/assignee/{id}": {- "put": {- "operationId": "updateTaskAssignee",- "tags": [- "Tasks"- ],- "description": "Assign or unassign a task to a user",- "responses": {- "200": {- "description": "Task assignee updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "userId": {- "type": "string"- }- },- "required": [- "userId"- ]- }- }- }- },- "summary": "Update Task Assignee"- }- },- "/task/due-date/{id}": {- "put": {- "operationId": "updateTaskDueDate",- "tags": [- "Tasks"- ],- "description": "Update only the due date of a task",- "responses": {- "200": {- "description": "Task due date updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "dueDate": {- "type": "string"- }- }- }- }- }- },- "summary": "Update Task Due Date"- }- },- "/task/title/{id}": {- "put": {- "operationId": "updateTaskTitle",- "tags": [- "Tasks"- ],- "description": "Update only the title of a task",- "responses": {- "200": {- "description": "Task title updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "title": {- "type": "string"- }- },- "required": [- "title"- ]- }- }- }- },- "summary": "Update Task Title"- }- },- "/task/description/{id}": {- "put": {- "operationId": "updateTaskDescription",- "tags": [- "Tasks"- ],- "description": "Update only the description of a task",- "responses": {- "200": {- "description": "Task description updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "description": {- "type": "string"- }- },- "required": [- "description"- ]- }- }- }- },- "summary": "Update Task Description"- }- },- "/column/{projectId}": {- "get": {- "operationId": "getColumns",- "tags": [- "Columns"- ],- "description": "Get all columns for a project",- "responses": {- "200": {- "description": "List of columns ordered by position",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Columns"- },- "post": {- "operationId": "createColumn",- "tags": [- "Columns"- ],- "description": "Create a new column in a project",- "responses": {- "200": {- "description": "Column created successfully",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "icon": {- "type": "string"- },- "color": {- "type": "string"- },- "isFinal": {- "type": "boolean"- }- },- "required": [- "name"- ]- }- }- }- },- "summary": "Create Column"- }- },- "/column/reorder/{projectId}": {- "put": {- "operationId": "reorderColumns",- "tags": [- "Columns"- ],- "description": "Reorder columns in a project",- "responses": {- "200": {- "description": "Columns reordered successfully",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "columns": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "position": {- "type": "number"- }- },- "required": [- "id",- "position"- ]- }- }- },- "required": [- "columns"- ]- }- }- }- },- "summary": "Reorder Columns"- }- },- "/column/{id}": {- "put": {- "operationId": "updateColumn",- "tags": [- "Columns"- ],- "description": "Update a column",- "responses": {- "200": {- "description": "Column updated successfully",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "icon": {- "type": "string",- "nullable": true- },- "color": {- "type": "string",- "nullable": true- },- "isFinal": {- "type": "boolean"- }- }- }- }- }- },- "summary": "Update Column"- },- "delete": {- "operationId": "deleteColumn",- "tags": [- "Columns"- ],- "description": "Delete a column",- "responses": {- "200": {- "description": "Column deleted successfully",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Delete Column"- }- },- "/activity/{taskId}": {- "get": {- "operationId": "getActivities",- "tags": [- "Activity"- ],- "description": "Get all activities for a specific task",- "responses": {- "200": {- "description": "List of activities for the task",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "type": {- "enum": [- "comment",- "task",- "status_changed",- "priority_changed",- "unassigned",- "assignee_changed",- "due_date_changed",- "title_changed",- "description_changed",- "create"- ]- },- "createdAt": {},- "userId": {- "type": "string",- "nullable": true- },- "content": {- "type": "string",- "nullable": true- },- "externalUserName": {- "type": "string",- "nullable": true- },- "externalUserAvatar": {- "type": "string",- "nullable": true- },- "externalSource": {- "type": "string",- "nullable": true- },- "externalUrl": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "taskId",- "type",- "createdAt",- "userId",- "content",- "externalUserName",- "externalUserAvatar",- "externalSource",- "externalUrl"- ]- }- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "taskId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Activities"- }- },- "/activity/create": {- "post": {- "operationId": "createActivity",- "tags": [- "Activity"- ],- "description": "Create a new activity (system-generated event)",- "responses": {- "200": {- "description": "Activity created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "type": {- "enum": [- "comment",- "task",- "status_changed",- "priority_changed",- "unassigned",- "assignee_changed",- "due_date_changed",- "title_changed",- "description_changed",- "create"- ]- },- "createdAt": {},- "userId": {- "type": "string",- "nullable": true- },- "content": {- "type": "string",- "nullable": true- },- "externalUserName": {- "type": "string",- "nullable": true- },- "externalUserAvatar": {- "type": "string",- "nullable": true- },- "externalSource": {- "type": "string",- "nullable": true- },- "externalUrl": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "taskId",- "type",- "createdAt",- "userId",- "content",- "externalUserName",- "externalUserAvatar",- "externalSource",- "externalUrl"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "taskId": {- "type": "string"- },- "userId": {- "type": "string"- },- "message": {- "type": "string"- },- "type": {- "type": "string"- }- },- "required": [- "taskId",- "userId",- "message",- "type"- ]- }- }- }- },- "summary": "Create Activity"- }- },- "/activity/comment": {- "post": {- "operationId": "createComment",- "tags": [- "Activity"- ],- "description": "Create a new comment on a task",- "responses": {- "200": {- "description": "Comment created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "type": {- "enum": [- "comment",- "task",- "status_changed",- "priority_changed",- "unassigned",- "assignee_changed",- "due_date_changed",- "title_changed",- "description_changed",- "create"- ]- },- "createdAt": {},- "userId": {- "type": "string",- "nullable": true- },- "content": {- "type": "string",- "nullable": true- },- "externalUserName": {- "type": "string",- "nullable": true- },- "externalUserAvatar": {- "type": "string",- "nullable": true- },- "externalSource": {- "type": "string",- "nullable": true- },- "externalUrl": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "taskId",- "type",- "createdAt",- "userId",- "content",- "externalUserName",- "externalUserAvatar",- "externalSource",- "externalUrl"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "taskId": {- "type": "string"- },- "comment": {- "type": "string"- }- },- "required": [- "taskId",- "comment"- ]- }- }- }- },- "summary": "Create Comment"- },- "put": {- "operationId": "updateComment",- "tags": [- "Activity"- ],- "description": "Update an existing comment",- "responses": {- "200": {- "description": "Comment updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "type": {- "enum": [- "comment",- "task",- "status_changed",- "priority_changed",- "unassigned",- "assignee_changed",- "due_date_changed",- "title_changed",- "description_changed",- "create"- ]- },- "createdAt": {},- "userId": {- "type": "string",- "nullable": true- },- "content": {- "type": "string",- "nullable": true- },- "externalUserName": {- "type": "string",- "nullable": true- },- "externalUserAvatar": {- "type": "string",- "nullable": true- },- "externalSource": {- "type": "string",- "nullable": true- },- "externalUrl": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "taskId",- "type",- "createdAt",- "userId",- "content",- "externalUserName",- "externalUserAvatar",- "externalSource",- "externalUrl"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "activityId": {- "type": "string"- },- "comment": {- "type": "string"- }- },- "required": [- "activityId",- "comment"- ]- }- }- }- },- "summary": "Update Comment"- },- "delete": {- "operationId": "deleteComment",- "tags": [- "Activity"- ],- "description": "Delete a comment",- "responses": {- "200": {- "description": "Comment deleted successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "type": {- "enum": [- "comment",- "task",- "status_changed",- "priority_changed",- "unassigned",- "assignee_changed",- "due_date_changed",- "title_changed",- "description_changed",- "create"- ]- },- "createdAt": {},- "userId": {- "type": "string",- "nullable": true- },- "content": {- "type": "string",- "nullable": true- },- "externalUserName": {- "type": "string",- "nullable": true- },- "externalUserAvatar": {- "type": "string",- "nullable": true- },- "externalSource": {- "type": "string",- "nullable": true- },- "externalUrl": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "taskId",- "type",- "createdAt",- "userId",- "content",- "externalUserName",- "externalUserAvatar",- "externalSource",- "externalUrl"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "activityId": {- "type": "string"- }- },- "required": [- "activityId"- ]- }- }- }- },- "summary": "Delete Comment"- }- },- "/time-entry/task/{taskId}": {- "get": {- "operationId": "getTaskTimeEntries",- "tags": [- "Time Entries"- ],- "description": "Get all time entries for a specific task",- "responses": {- "200": {- "description": "List of time entries for the task",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "userId": {- "type": "string",- "nullable": true- },- "description": {- "type": "string",- "nullable": true- },- "startTime": {},- "endTime": {},- "duration": {- "type": "number",- "nullable": true- },- "createdAt": {}- },- "required": [- "id",- "taskId",- "userId",- "description",- "startTime",- "duration",- "createdAt"- ]- }- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "taskId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Task Time Entries"- }- },- "/time-entry/{id}": {- "get": {- "operationId": "getTimeEntry",- "tags": [- "Time Entries"- ],- "description": "Get a specific time entry by ID",- "responses": {- "200": {- "description": "Time entry details",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "userId": {- "type": "string",- "nullable": true- },- "description": {- "type": "string",- "nullable": true- },- "startTime": {},- "endTime": {},- "duration": {- "type": "number",- "nullable": true- },- "createdAt": {}- },- "required": [- "id",- "taskId",- "userId",- "description",- "startTime",- "duration",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Time Entry"- },- "put": {- "operationId": "updateTimeEntry",- "tags": [- "Time Entries"- ],- "description": "Update an existing time entry",- "responses": {- "200": {- "description": "Time entry updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "userId": {- "type": "string",- "nullable": true- },- "description": {- "type": "string",- "nullable": true- },- "startTime": {},- "endTime": {},- "duration": {- "type": "number",- "nullable": true- },- "createdAt": {}- },- "required": [- "id",- "taskId",- "userId",- "description",- "startTime",- "duration",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "startTime": {- "type": "string"- },- "endTime": {- "type": "string"- },- "description": {- "type": "string"- }- },- "required": [- "startTime"- ]- }- }- }- },- "summary": "Update Time Entry"- }- },- "/time-entry": {- "post": {- "operationId": "createTimeEntry",- "tags": [- "Time Entries"- ],- "description": "Create a new time entry for a task",- "responses": {- "200": {- "description": "Time entry created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "userId": {- "type": "string",- "nullable": true- },- "description": {- "type": "string",- "nullable": true- },- "startTime": {},- "endTime": {},- "duration": {- "type": "number",- "nullable": true- },- "createdAt": {}- },- "required": [- "id",- "taskId",- "userId",- "description",- "startTime",- "duration",- "createdAt"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "taskId": {- "type": "string"- },- "startTime": {- "type": "string"- },- "endTime": {- "type": "string"- },- "description": {- "type": "string"- }- },- "required": [- "taskId",- "startTime"- ]- }- }- }- },- "summary": "Create Time Entry"- }- },- "/label/task/{taskId}": {- "get": {- "operationId": "getTaskLabels",- "tags": [- "Labels"- ],- "description": "Get all labels assigned to a specific task",- "responses": {- "200": {- "description": "List of labels for the task",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "color": {- "type": "string"- },- "createdAt": {},- "taskId": {- "type": "string",- "nullable": true- },- "workspaceId": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "name",- "color",- "createdAt",- "taskId",- "workspaceId"- ]- }- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "taskId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Task Labels"- }- },- "/label/workspace/{workspaceId}": {- "get": {- "operationId": "getWorkspaceLabels",- "tags": [- "Labels"- ],- "description": "Get all labels for a specific workspace",- "responses": {- "200": {- "description": "List of labels in the workspace",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "color": {- "type": "string"- },- "createdAt": {},- "taskId": {- "type": "string",- "nullable": true- },- "workspaceId": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "name",- "color",- "createdAt",- "taskId",- "workspaceId"- ]- }- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "workspaceId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Workspace Labels"- }- },- "/label": {- "post": {- "operationId": "createLabel",- "tags": [- "Labels"- ],- "description": "Create a new label in a workspace",- "responses": {- "200": {- "description": "Label created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "color": {- "type": "string"- },- "createdAt": {},- "taskId": {- "type": "string",- "nullable": true- },- "workspaceId": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "name",- "color",- "createdAt",- "taskId",- "workspaceId"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "color": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "taskId": {- "type": "string"- }- },- "required": [- "name",- "color",- "workspaceId"- ]- }- }- }- },- "summary": "Create Label"- }- },- "/label/{id}": {- "get": {- "operationId": "getLabel",- "tags": [- "Labels"- ],- "description": "Get a specific label by ID",- "responses": {- "200": {- "description": "Label details",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "color": {- "type": "string"- },- "createdAt": {},- "taskId": {- "type": "string",- "nullable": true- },- "workspaceId": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "name",- "color",- "createdAt",- "taskId",- "workspaceId"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Label"- },- "put": {- "operationId": "updateLabel",- "tags": [- "Labels"- ],- "description": "Update an existing label",- "responses": {- "200": {- "description": "Label updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "color": {- "type": "string"- },- "createdAt": {},- "taskId": {- "type": "string",- "nullable": true- },- "workspaceId": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "name",- "color",- "createdAt",- "taskId",- "workspaceId"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "color": {- "type": "string"- }- },- "required": [- "name",- "color"- ]- }- }- }- },- "summary": "Update Label"- },- "delete": {- "operationId": "deleteLabel",- "tags": [- "Labels"- ],- "description": "Delete a label by ID",- "responses": {- "200": {- "description": "Label deleted successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "color": {- "type": "string"- },- "createdAt": {},- "taskId": {- "type": "string",- "nullable": true- },- "workspaceId": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "name",- "color",- "createdAt",- "taskId",- "workspaceId"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Delete Label"- }- },- "/notification": {- "get": {- "operationId": "listNotifications",- "tags": [- "Notifications"- ],- "description": "Get all notifications for the current user",- "responses": {- "200": {- "description": "List of notifications",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "userId": {- "type": "string"- },- "title": {- "type": "string"- },- "content": {- "type": "string",- "nullable": true- },- "type": {- "enum": [- "info",- "task_created",- "workspace_created",- "task_status_changed",- "task_assignee_changed",- "time_entry_created"- ]- },- "isRead": {- "type": "boolean"- },- "resourceId": {- "type": "string"- },- "resourceType": {- "enum": [- "task",- "workspace"- ]- },- "createdAt": {}- },- "required": [- "id",- "userId",- "title",- "content",- "type",- "createdAt"- ]- }- }- }- }- }- },- "summary": "List Notifications"- },- "post": {- "operationId": "createNotification",- "tags": [- "Notifications"- ],- "description": "Create a new notification for a user",- "responses": {- "200": {- "description": "Notification created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "userId": {- "type": "string"- },- "title": {- "type": "string"- },- "content": {- "type": "string",- "nullable": true- },- "type": {- "enum": [- "info",- "task_created",- "workspace_created",- "task_status_changed",- "task_assignee_changed",- "time_entry_created"- ]- },- "isRead": {- "type": "boolean"- },- "resourceId": {- "type": "string"- },- "resourceType": {- "enum": [- "task",- "workspace"- ]- },- "createdAt": {}- },- "required": [- "id",- "userId",- "title",- "content",- "type",- "createdAt"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "userId": {- "type": "string"- },- "title": {- "type": "string"- },- "message": {- "type": "string"- },- "type": {- "type": "string"- },- "relatedEntityId": {- "type": "string"- },- "relatedEntityType": {- "type": "string"- }- },- "required": [- "userId",- "title",- "message",- "type"- ]- }- }- }- },- "summary": "Create Notification"- }- },- "/notification/{id}/read": {- "patch": {- "operationId": "markNotificationAsRead",- "tags": [- "Notifications"- ],- "description": "Mark a specific notification as read",- "responses": {- "200": {- "description": "Notification marked as read",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "userId": {- "type": "string"- },- "title": {- "type": "string"- },- "content": {- "type": "string",- "nullable": true- },- "type": {- "enum": [- "info",- "task_created",- "workspace_created",- "task_status_changed",- "task_assignee_changed",- "time_entry_created"- ]- },- "isRead": {- "type": "boolean"- },- "resourceId": {- "type": "string"- },- "resourceType": {- "enum": [- "task",- "workspace"- ]- },- "createdAt": {}- },- "required": [- "id",- "userId",- "title",- "content",- "type",- "createdAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Mark Notification As Read"- }- },- "/notification/read-all": {- "patch": {- "operationId": "markAllNotificationsAsRead",- "tags": [- "Notifications"- ],- "description": "Mark all notifications as read for the current user",- "responses": {- "200": {- "description": "All notifications marked as read",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "success": {- "type": "boolean"- },- "count": {- "type": "number"- }- },- "required": [- "success"- ]- }- }- }- }- },- "summary": "Mark All Notifications As Read"- }- },- "/notification/clear-all": {- "delete": {- "operationId": "clearAllNotifications",- "tags": [- "Notifications"- ],- "description": "Clear all notifications for the current user",- "responses": {- "200": {- "description": "All notifications cleared",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "success": {- "type": "boolean"- },- "count": {- "type": "number"- }- },- "required": [- "success"- ]- }- }- }- }- },- "summary": "Clear All Notifications"- }- },- "/search": {- "get": {- "operationId": "globalSearch",- "tags": [- "Search"- ],- "description": "Search across tasks, projects, workspaces, comments, and activities",- "responses": {- "200": {- "description": "Search results",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "tasks": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "position": {- "type": "number",- "nullable": true- },- "number": {- "type": "number",- "nullable": true- },- "userId": {- "type": "string",- "nullable": true- },- "title": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "status": {- "type": "string"- },- "priority": {- "enum": [- "no-priority",- "low",- "medium",- "high",- "urgent"- ]- },- "dueDate": {},- "createdAt": {}- },- "required": [- "id",- "projectId",- "position",- "number",- "userId",- "title",- "description",- "status",- "priority",- "createdAt"- ]- }- },- "projects": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "slug": {- "type": "string"- },- "icon": {- "type": "string",- "nullable": true- },- "name": {- "type": "string"- },- "description": {- "type": "string",- "nullable": true- },- "createdAt": {},- "isPublic": {- "type": "boolean",- "nullable": true- }- },- "required": [- "id",- "workspaceId",- "slug",- "icon",- "name",- "description",- "createdAt",- "isPublic"- ]- }- },- "workspaces": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "slug": {- "type": "string"- },- "logo": {- "type": "string",- "nullable": true- },- "metadata": {- "type": "string",- "nullable": true- },- "description": {- "type": "string",- "nullable": true- },- "createdAt": {}- },- "required": [- "id",- "name",- "slug",- "logo",- "metadata",- "description",- "createdAt"- ]- }- },- "comments": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "type": {- "enum": [- "comment",- "task",- "status_changed",- "priority_changed",- "unassigned",- "assignee_changed",- "due_date_changed",- "title_changed",- "description_changed",- "create"- ]- },- "createdAt": {},- "userId": {- "type": "string",- "nullable": true- },- "content": {- "type": "string",- "nullable": true- },- "externalUserName": {- "type": "string",- "nullable": true- },- "externalUserAvatar": {- "type": "string",- "nullable": true- },- "externalSource": {- "type": "string",- "nullable": true- },- "externalUrl": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "taskId",- "type",- "createdAt",- "userId",- "content",- "externalUserName",- "externalUserAvatar",- "externalSource",- "externalUrl"- ]- }- },- "activities": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "type": {- "enum": [- "comment",- "task",- "status_changed",- "priority_changed",- "unassigned",- "assignee_changed",- "due_date_changed",- "title_changed",- "description_changed",- "create"- ]- },- "createdAt": {},- "userId": {- "type": "string",- "nullable": true- },- "content": {- "type": "string",- "nullable": true- },- "externalUserName": {- "type": "string",- "nullable": true- },- "externalUserAvatar": {- "type": "string",- "nullable": true- },- "externalSource": {- "type": "string",- "nullable": true- },- "externalUrl": {- "type": "string",- "nullable": true- }- },- "required": [- "id",- "taskId",- "type",- "createdAt",- "userId",- "content",- "externalUserName",- "externalUserAvatar",- "externalSource",- "externalUrl"- ]- }- }- }- }- }- }- }- },- "parameters": [- {- "in": "query",- "name": "q",- "schema": {- "type": "string",- "minLength": 1- },- "required": true- },- {- "in": "query",- "name": "type",- "schema": {- "enum": [- "all",- "tasks",- "projects",- "workspaces",- "comments",- "activities"- ],- "default": "all"- }- },- {- "in": "query",- "name": "workspaceId",- "schema": {- "type": "string"- }- },- {- "in": "query",- "name": "projectId",- "schema": {- "type": "string"- }- },- {- "in": "query",- "name": "limit",- "schema": {- "type": "string",- "minimum": 1,- "maximum": 50,- "default": "20"- }- },- {- "in": "query",- "name": "userEmail",- "schema": {- "type": "string",- "format": "email"- }- }- ],- "summary": "Global Search"- }- },- "/github-integration/app-info": {- "get": {- "operationId": "getGitHubAppInfo",- "tags": [- "GitHub"- ],- "description": "Get GitHub app configuration information",- "responses": {- "200": {- "description": "GitHub app information",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "appName": {- "type": "string",- "nullable": true- }- },- "required": [- "appName"- ]- }- }- }- }- },- "summary": "Get Git Hub App Info"- }- },- "/github-integration/repositories": {- "get": {- "operationId": "listGitHubRepositories",- "tags": [- "GitHub"- ],- "description": "List all accessible GitHub repositories",- "responses": {- "200": {- "description": "List of repositories",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "number"- },- "name": {- "type": "string"- },- "full_name": {- "type": "string"- },- "owner": {- "type": "object",- "properties": {- "login": {- "type": "string"- }- },- "required": [- "login"- ]- },- "private": {- "type": "boolean"- },- "html_url": {- "type": "string"- }- },- "required": [- "id",- "name",- "full_name",- "owner",- "private",- "html_url"- ]- }- }- }- }- }- },- "summary": "List Git Hub Repositories"- }- },- "/github-integration/verify": {- "post": {- "operationId": "verifyGitHubInstallation",- "tags": [- "GitHub"- ],- "description": "Verify GitHub app installation for a repository",- "responses": {- "200": {- "description": "Verification result",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "installed": {- "type": "boolean"- },- "message": {- "type": "string"- }- },- "required": [- "installed"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "repositoryOwner": {- "type": "string",- "minLength": 1- },- "repositoryName": {- "type": "string",- "minLength": 1- }- },- "required": [- "repositoryOwner",- "repositoryName"- ]- }- }- }- },- "summary": "Verify Git Hub Installation"- }- },- "/github-integration/project/{projectId}": {- "get": {- "operationId": "getGitHubIntegration",- "tags": [- "GitHub"- ],- "description": "Get GitHub integration for a project",- "responses": {- "200": {- "description": "GitHub integration details",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "repositoryOwner": {- "type": "string"- },- "repositoryName": {- "type": "string"- },- "installationId": {- "type": "number",- "nullable": true- },- "isActive": {- "type": "boolean",- "nullable": true- },- "createdAt": {},- "updatedAt": {}- },- "required": [- "id",- "projectId",- "repositoryOwner",- "repositoryName",- "installationId",- "isActive",- "createdAt",- "updatedAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Git Hub Integration"- },- "post": {- "operationId": "createGitHubIntegration",- "tags": [- "GitHub"- ],- "description": "Create a new GitHub integration for a project",- "responses": {- "200": {- "description": "Integration created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "repositoryOwner": {- "type": "string"- },- "repositoryName": {- "type": "string"- },- "installationId": {- "type": "number",- "nullable": true- },- "isActive": {- "type": "boolean",- "nullable": true- },- "createdAt": {},- "updatedAt": {}- },- "required": [- "id",- "projectId",- "repositoryOwner",- "repositoryName",- "installationId",- "isActive",- "createdAt",- "updatedAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "repositoryOwner": {- "type": "string",- "minLength": 1- },- "repositoryName": {- "type": "string",- "minLength": 1- }- },- "required": [- "repositoryOwner",- "repositoryName"- ]- }- }- }- },- "summary": "Create Git Hub Integration"- },- "patch": {- "operationId": "updateGitHubIntegration",- "tags": [- "GitHub"- ],- "description": "Update GitHub integration settings",- "responses": {- "200": {- "description": "Integration updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "repositoryOwner": {- "type": "string"- },- "repositoryName": {- "type": "string"- },- "installationId": {- "type": "number",- "nullable": true- },- "isActive": {- "type": "boolean",- "nullable": true- },- "createdAt": {},- "updatedAt": {}- },- "required": [- "id",- "projectId",- "repositoryOwner",- "repositoryName",- "installationId",- "isActive",- "createdAt",- "updatedAt"- ]- }- }- }- },- "404": {- "description": "Integration not found",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "error": {- "type": "string"- }- },- "required": [- "error"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "isActive": {- "type": "boolean"- }- }- }- }- }- },- "summary": "Update Git Hub Integration"- },- "delete": {- "operationId": "deleteGitHubIntegration",- "tags": [- "GitHub"- ],- "description": "Delete GitHub integration for a project",- "responses": {- "200": {- "description": "Integration deleted successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "projectId": {- "type": "string"- },- "repositoryOwner": {- "type": "string"- },- "repositoryName": {- "type": "string"- },- "installationId": {- "type": "number",- "nullable": true- },- "isActive": {- "type": "boolean",- "nullable": true- },- "createdAt": {},- "updatedAt": {}- },- "required": [- "id",- "projectId",- "repositoryOwner",- "repositoryName",- "installationId",- "isActive",- "createdAt",- "updatedAt"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Delete Git Hub Integration"- }- },- "/github-integration/import-issues": {- "post": {- "operationId": "importGitHubIssues",- "tags": [- "GitHub"- ],- "description": "Import GitHub issues as tasks",- "responses": {- "200": {- "description": "Issues imported successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "imported": {- "type": "number"- },- "skipped": {- "type": "number"- },- "errors": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "imported",- "skipped"- ]- }- }- }- }- },- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "projectId": {- "type": "string"- }- },- "required": [- "projectId"- ]- }- }- }- },- "summary": "Import Git Hub Issues"- }- },- "/external-link/task/{taskId}": {- "get": {- "operationId": "getExternalLinksByTask",- "tags": [- "External Links"- ],- "description": "Get all external links for a task",- "responses": {- "200": {- "description": "External links for the task",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "taskId": {- "type": "string"- },- "integrationId": {- "type": "string"- },- "resourceType": {- "type": "string"- },- "externalId": {- "type": "string"- },- "url": {- "type": "string"- },- "title": {- "type": "string",- "nullable": true- },- "metadata": {},- "createdAt": {},- "updatedAt": {}- },- "required": [- "id",- "taskId",- "integrationId",- "resourceType",- "externalId",- "url",- "title",- "metadata",- "createdAt",- "updatedAt"- ]- }- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "taskId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get External Links By Task"- }- },- "/workflow-rule/{projectId}": {- "get": {- "operationId": "getWorkflowRules",- "tags": [- "Workflow Rules"- ],- "description": "Get all workflow rules for a project",- "responses": {- "200": {- "description": "List of workflow rules",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Workflow Rules"- },- "put": {- "operationId": "upsertWorkflowRule",- "tags": [- "Workflow Rules"- ],- "description": "Create or update a workflow rule",- "responses": {- "200": {- "description": "Workflow rule upserted successfully",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "projectId",- "schema": {- "type": "string"- },- "required": true- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "integrationType": {- "type": "string"- },- "eventType": {- "type": "string"- },- "columnId": {- "type": "string"- }- },- "required": [- "integrationType",- "eventType",- "columnId"- ]- }- }- }- },- "summary": "Upsert Workflow Rule"- }- },- "/workflow-rule/{id}": {- "delete": {- "operationId": "deleteWorkflowRule",- "tags": [- "Workflow Rules"- ],- "description": "Delete a workflow rule",- "responses": {- "200": {- "description": "Workflow rule deleted successfully",- "content": {- "application/json": {- "schema": {}- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Delete Workflow Rule"- }- },- "/invitation/pending": {- "get": {- "operationId": "getUserPendingInvitations",- "tags": [- "Invitations"- ],- "description": "Get all pending invitations for the current user",- "responses": {- "200": {- "description": "List of pending invitations",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "email": {- "type": "string"- },- "workspaceId": {- "type": "string"- },- "workspaceName": {- "type": "string"- },- "inviterName": {- "type": "string"- },- "expiresAt": {- "type": "string"- },- "createdAt": {- "type": "string"- },- "status": {- "type": "string"- }- },- "required": [- "id",- "email",- "workspaceId",- "workspaceName",- "inviterName",- "expiresAt",- "createdAt",- "status"- ]- }- }- }- }- }- },- "summary": "Get User Pending Invitations"- }- },- "/invitation/{id}": {- "get": {- "operationId": "getInvitationDetails",- "tags": [- "Invitations"- ],- "description": "Get details of a specific invitation by ID",- "responses": {- "200": {- "description": "Invitation details",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "valid": {- "type": "boolean"- },- "invitation": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "email": {- "type": "string"- },- "workspaceName": {- "type": "string"- },- "inviterName": {- "type": "string"- },- "expiresAt": {- "type": "string"- },- "status": {- "type": "string"- },- "expired": {- "type": "boolean"- }- },- "required": [- "id",- "email",- "workspaceName",- "inviterName",- "expiresAt",- "status",- "expired"- ]- },- "error": {- "type": "string"- }- },- "required": [- "valid"- ]- }- }- }- }- },- "parameters": [- {- "in": "path",- "name": "id",- "schema": {- "type": "string"- },- "required": true- }- ],- "summary": "Get Invitation Details"- }- },- "/auth/organization/create": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Create an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string",- "description": "The name of the organization"- },- "slug": {- "type": "string",- "description": "The slug of the organization"- },- "userId": {- "type": "string",- "description": "The user id of the organization creator. If not provided, the current user will be used. Should only be used by admins or when called by the server. server-only. Eg: \"user-id\"",- "nullable": true- },- "logo": {- "type": "string",- "description": "The logo of the organization",- "nullable": true- },- "metadata": {- "type": "string",- "description": "The metadata of the organization",- "nullable": true- },- "keepCurrentActiveOrganization": {- "type": "boolean",- "description": "Whether to keep the current active organization active after creating a new one. Eg: true",- "nullable": true- },- "description": {- "type": "string",- "nullable": true- }- },- "required": [- "name",- "slug"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "description": "The organization that was created",- "$ref": "#/components/schemas/Organization"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "createOrganization",- "summary": "Create Organization"- }- },- "/auth/organization/update": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Update an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "data": {- "type": "object",- "properties": {- "description": {- "type": "string",- "nullable": true- },- "name": {- "type": "string",- "description": "The name of the organization",- "nullable": true- },- "slug": {- "type": "string",- "description": "The slug of the organization",- "nullable": true- },- "logo": {- "type": "string",- "description": "The logo of the organization",- "nullable": true- },- "metadata": {- "type": "string",- "description": "The metadata of the organization",- "nullable": true- }- }- },- "organizationId": {- "type": "string",- "description": "The organization ID. Eg: \"org-id\"",- "nullable": true- }- },- "required": [- "data"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "description": "The updated organization",- "$ref": "#/components/schemas/Organization"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "updateOrganization",- "summary": "Update Organization"- }- },- "/auth/organization/delete": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Delete an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "organizationId": {- "type": "string",- "description": "The organization id to delete"- }- },- "required": [- "organizationId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "string",- "description": "The organization id that was deleted"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "deleteOrganization",- "summary": "Delete Organization"- }- },- "/auth/organization/set-active": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Set the active organization",- "operationId": "setOrganizationActive",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "organizationId": {- "type": "string",- "nullable": true- },- "organizationSlug": {- "type": "string",- "description": "The organization slug to set as active. It can be null to unset the active organization if organizationId is not provided. Eg: \"org-slug\"",- "nullable": true- }- }- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "description": "The organization",- "$ref": "#/components/schemas/Organization"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "summary": "Set Organization Active"- }- },- "/auth/organization/get-full-organization": {- "get": {- "tags": [- "Organization Management"- ],- "description": "Get the full organization",- "operationId": "getOrganizationFullOrganization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "description": "The organization",- "$ref": "#/components/schemas/Organization"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "summary": "Get Organization Full Organization"- }- },- "/auth/organization/list": {- "get": {- "tags": [- "Organization Management"- ],- "description": "List all organizations",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#/components/schemas/Organization"- }- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "listOrganization",- "summary": "List Organization"- }- },- "/auth/organization/invite-member": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Create an invitation to an organization",- "operationId": "inviteOrganizationMember",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "email": {- "type": "string",- "description": "The email address of the user to invite"- },- "role": {- "type": "string",- "description": "The role(s) to assign to the user. It can be `admin`, `member`, owner. Eg: \"member\""- },- "organizationId": {- "type": "string",- "description": "The organization ID to invite the user to",- "nullable": true- },- "resend": {- "type": "boolean",- "description": "Resend the invitation email, if the user is already invited. Eg: true",- "nullable": true- },- "teamId": {- "type": "string"- }- },- "required": [- "email",- "role",- "teamId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "email": {- "type": "string"- },- "role": {- "type": "string"- },- "organizationId": {- "type": "string"- },- "inviterId": {- "type": "string"- },- "status": {- "type": "string"- },- "expiresAt": {- "type": "string"- },- "createdAt": {- "type": "string"- }- },- "required": [- "id",- "email",- "role",- "organizationId",- "inviterId",- "status",- "expiresAt",- "createdAt"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "summary": "Invite Organization Member"- }- },- "/auth/organization/cancel-invitation": {- "post": {- "tags": [- "Organization Management"- ],- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "invitationId": {- "type": "string",- "description": "The ID of the invitation to cancel"- }- },- "required": [- "invitationId"- ]- }- }- }- },- "responses": {- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "cancelOrganizationInvitation",- "summary": "Cancel Organization Invitation"- }- },- "/auth/organization/accept-invitation": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Accept an invitation to an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "invitationId": {- "type": "string",- "description": "The ID of the invitation to accept"- }- },- "required": [- "invitationId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "invitation": {- "type": "object"- },- "member": {- "type": "object"- }- }- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "acceptOrganizationInvitation",- "summary": "Accept Organization Invitation"- }- },- "/auth/organization/get-invitation": {- "get": {- "tags": [- "Organization Management"- ],- "description": "Get an invitation by ID",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [- {- "name": "id",- "in": "query",- "schema": {- "type": "string",- "description": "The ID of the invitation to get"- }- }- ],- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "email": {- "type": "string"- },- "role": {- "type": "string"- },- "organizationId": {- "type": "string"- },- "inviterId": {- "type": "string"- },- "status": {- "type": "string"- },- "expiresAt": {- "type": "string"- },- "organizationName": {- "type": "string"- },- "organizationSlug": {- "type": "string"- },- "inviterEmail": {- "type": "string"- }- },- "required": [- "id",- "email",- "role",- "organizationId",- "inviterId",- "status",- "expiresAt",- "organizationName",- "organizationSlug",- "inviterEmail"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "getOrganizationInvitation",- "summary": "Get Organization Invitation"- }- },- "/auth/organization/reject-invitation": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Reject an invitation to an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "invitationId": {- "type": "string",- "description": "The ID of the invitation to reject"- }- },- "required": [- "invitationId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "invitation": {- "type": "object"- },- "member": {- "type": "object",- "nullable": true- }- }- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "rejectOrganizationInvitation",- "summary": "Reject Organization Invitation"- }- },- "/auth/organization/list-invitations": {- "get": {- "tags": [- "Organization Management"- ],- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "listOrganizationInvitations",- "summary": "List Organization Invitations"- }- },- "/auth/organization/get-active-member": {- "get": {- "tags": [- "Organization Management"- ],- "description": "Get the member details of the active organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "userId": {- "type": "string"- },- "organizationId": {- "type": "string"- },- "role": {- "type": "string"- }- },- "required": [- "id",- "userId",- "organizationId",- "role"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "getOrganizationActiveMember",- "summary": "Get Organization Active Member"- }- },- "/auth/organization/check-slug": {- "post": {- "tags": [- "Organization Management"- ],- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "slug": {- "type": "string",- "description": "The organization slug to check. Eg: \"my-org\""- }- },- "required": [- "slug"- ]- }- }- }- },- "responses": {- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "checkOrganizationSlug",- "summary": "Check Organization Slug"- }- },- "/auth/organization/remove-member": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Remove a member from an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "memberIdOrEmail": {- "type": "string",- "description": "The ID or email of the member to remove"- },- "organizationId": {- "type": "string",- "description": "The ID of the organization to remove the member from. If not provided, the active organization will be used. Eg: \"org-id\"",- "nullable": true- }- },- "required": [- "memberIdOrEmail"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "member": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "userId": {- "type": "string"- },- "organizationId": {- "type": "string"- },- "role": {- "type": "string"- }- },- "required": [- "id",- "userId",- "organizationId",- "role"- ]- }- },- "required": [- "member"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "removeOrganizationMember",- "summary": "Remove Organization Member"- }- },- "/auth/organization/update-member-role": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Update the role of a member in an organization",- "operationId": "updateOrganizationMemberRole",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "role": {- "type": "string",- "description": "The new role to be applied. This can be a string or array of strings representing the roles. Eg: [\"admin\", \"sale\"]"- },- "memberId": {- "type": "string",- "description": "The member id to apply the role update to. Eg: \"member-id\""- },- "organizationId": {- "type": "string",- "description": "An optional organization ID which the member is a part of to apply the role update. If not provided, you must provide session headers to get the active organization. Eg: \"organization-id\"",- "nullable": true- }- },- "required": [- "role",- "memberId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "member": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "userId": {- "type": "string"- },- "organizationId": {- "type": "string"- },- "role": {- "type": "string"- }- },- "required": [- "id",- "userId",- "organizationId",- "role"- ]- }- },- "required": [- "member"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "summary": "Update Organization Member Role"- }- },- "/auth/organization/leave": {- "post": {- "tags": [- "Organization Management"- ],- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "organizationId": {- "type": "string",- "description": "The organization Id for the member to leave. Eg: \"organization-id\""- }- },- "required": [- "organizationId"- ]- }- }- }- },- "responses": {- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "leaveOrganization",- "summary": "Leave Organization"- }- },- "/auth/organization/list-user-invitations": {- "get": {- "tags": [- "Organization Management"- ],- "description": "List all invitations a user has received",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "email": {- "type": "string"- },- "role": {- "type": "string"- },- "organizationId": {- "type": "string"- },- "organizationName": {- "type": "string"- },- "inviterId": {- "type": "string",- "description": "The ID of the user who created the invitation"- },- "teamId": {- "type": "string",- "description": "The ID of the team associated with the invitation",- "nullable": true- },- "status": {- "type": "string"- },- "expiresAt": {- "type": "string"- },- "createdAt": {- "type": "string"- }- },- "required": [- "id",- "email",- "role",- "organizationId",- "organizationName",- "inviterId",- "status",- "expiresAt",- "createdAt"- ]- }- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "listOrganizationUserInvitations",- "summary": "List Organization User Invitations"- }- },- "/auth/organization/list-members": {- "get": {- "tags": [- "Organization Management"- ],- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "listOrganizationMembers",- "summary": "List Organization Members"- }- },- "/auth/organization/get-active-member-role": {- "get": {- "tags": [- "Organization Management"- ],- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "getOrganizationActiveMemberRole",- "summary": "Get Organization Active Member Role"- }- },- "/auth/organization/create-team": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Create a new team within an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string",- "description": "The name of the team. Eg: \"my-team\""- },- "organizationId": {- "type": "string",- "description": "The organization ID which the team will be created in. Defaults to the active organization. Eg: \"organization-id\"",- "nullable": true- }- },- "required": [- "name"- ]- }- }- }- },- "responses": {- "200": {- "description": "Team created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string",- "description": "Unique identifier of the created team"- },- "name": {- "type": "string",- "description": "Name of the team"- },- "organizationId": {- "type": "string",- "description": "ID of the organization the team belongs to"- },- "createdAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team was created"- },- "updatedAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team was last updated"- }- },- "required": [- "id",- "name",- "organizationId",- "createdAt",- "updatedAt"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "createOrganizationTeam",- "summary": "Create Organization Team"- }- },- "/auth/organization/list-teams": {- "get": {- "tags": [- "Organization Management"- ],- "description": "List all teams in an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "200": {- "description": "Teams retrieved successfully",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string",- "description": "Unique identifier of the team"- },- "name": {- "type": "string",- "description": "Name of the team"- },- "organizationId": {- "type": "string",- "description": "ID of the organization the team belongs to"- },- "createdAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team was created"- },- "updatedAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team was last updated"- }- },- "required": [- "id",- "name",- "organizationId",- "createdAt",- "updatedAt"- ]- },- "description": "Array of team objects within the organization"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "listOrganizationTeams",- "summary": "List Organization Teams"- }- },- "/auth/organization/remove-team": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Remove a team from an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "teamId": {- "type": "string",- "description": "The team ID of the team to remove. Eg: \"team-id\""- },- "organizationId": {- "type": "string",- "description": "The organization ID which the team falls under. If not provided, it will default to the user's active organization. Eg: \"organization-id\"",- "nullable": true- }- },- "required": [- "teamId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Team removed successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string",- "description": "Confirmation message indicating successful removal",- "enum": [- "Team removed successfully."- ]- }- },- "required": [- "message"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "removeOrganizationTeam",- "summary": "Remove Organization Team"- }- },- "/auth/organization/update-team": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Update an existing team in an organization",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "teamId": {- "type": "string",- "description": "The ID of the team to be updated. Eg: \"team-id\""- },- "data": {- "type": "object",- "properties": {- "id": {- "type": "string",- "default": "vrJTKvZCXxj4Lop9wiAMXpztxBHNJnZF",- "nullable": true- },- "name": {- "type": "string",- "nullable": true- },- "organizationId": {- "type": "string",- "nullable": true- },- "createdAt": {- "type": "string",- "nullable": true- },- "updatedAt": {- "type": "string",- "nullable": true- }- }- }- },- "required": [- "teamId",- "data"- ]- }- }- }- },- "responses": {- "200": {- "description": "Team updated successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string",- "description": "Unique identifier of the updated team"- },- "name": {- "type": "string",- "description": "Updated name of the team"- },- "organizationId": {- "type": "string",- "description": "ID of the organization the team belongs to"- },- "createdAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team was created"- },- "updatedAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team was last updated"- }- },- "required": [- "id",- "name",- "organizationId",- "createdAt",- "updatedAt"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "updateOrganizationTeam",- "summary": "Update Organization Team"- }- },- "/auth/organization/set-active-team": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Set the active team",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "teamId": {- "type": "string",- "nullable": true- }- }- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "description": "The team",- "$ref": "#/components/schemas/Team"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "setOrganizationActiveTeam",- "summary": "Set Organization Active Team"- }- },- "/auth/organization/list-user-teams": {- "get": {- "tags": [- "Organization Management"- ],- "description": "List all teams that the current user is a part of.",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "200": {- "description": "Teams retrieved successfully",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "description": "The team",- "$ref": "#/components/schemas/Team"- },- "description": "Array of team objects within the organization"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "listOrganizationUserTeams",- "summary": "List Organization User Teams"- }- },- "/auth/organization/list-team-members": {- "get": {- "tags": [- "Organization Management"- ],- "description": "List the members of the given team.",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "responses": {- "200": {- "description": "Teams retrieved successfully",- "content": {- "application/json": {- "schema": {- "type": "array",- "items": {- "type": "object",- "description": "The team member",- "properties": {- "id": {- "type": "string",- "description": "Unique identifier of the team member"- },- "userId": {- "type": "string",- "description": "The user ID of the team member"- },- "teamId": {- "type": "string",- "description": "The team ID of the team the team member is in"- },- "createdAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team member was created"- }- },- "required": [- "id",- "userId",- "teamId",- "createdAt"- ]- },- "description": "Array of team member objects within the team"- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "listOrganizationTeamMembers",- "summary": "List Organization Team Members"- }- },- "/auth/organization/add-team-member": {- "post": {- "tags": [- "Organization Management"- ],- "description": "The newly created member",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "teamId": {- "type": "string",- "description": "The team the user should be a member of."- },- "userId": {- "type": "string",- "description": "The user Id which represents the user to be added as a member."- }- },- "required": [- "teamId",- "userId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Team member created successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "description": "The team member",- "properties": {- "id": {- "type": "string",- "description": "Unique identifier of the team member"- },- "userId": {- "type": "string",- "description": "The user ID of the team member"- },- "teamId": {- "type": "string",- "description": "The team ID of the team the team member is in"- },- "createdAt": {- "type": "string",- "format": "date-time",- "description": "Timestamp when the team member was created"- }- },- "required": [- "id",- "userId",- "teamId",- "createdAt"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "addOrganizationTeamMember",- "summary": "Add Organization Team Member"- }- },- "/auth/organization/remove-team-member": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Remove a member from a team",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "teamId": {- "type": "string",- "description": "The team the user should be removed from."- },- "userId": {- "type": "string",- "description": "The user which should be removed from the team."- }- },- "required": [- "teamId",- "userId"- ]- }- }- }- },- "responses": {- "200": {- "description": "Team member removed successfully",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string",- "description": "Confirmation message indicating successful removal",- "enum": [- "Team member removed successfully."- ]- }- },- "required": [- "message"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "removeOrganizationTeamMember",- "summary": "Remove Organization Team Member"- }- },- "/auth/organization/has-permission": {- "post": {- "tags": [- "Organization Management"- ],- "description": "Check if the user has permission",- "security": [- {- "bearerAuth": []- }- ],- "parameters": [],- "requestBody": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "permission": {- "type": "object",- "description": "The permission to check",- "deprecated": true- },- "permissions": {- "type": "object",- "description": "The permission to check"- }- },- "required": [- "permissions"- ]- }- }- }- },- "responses": {- "200": {- "description": "Success",- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "error": {- "type": "string"- },- "success": {- "type": "boolean"- }- },- "required": [- "success"- ]- }- }- }- },- "400": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Bad Request. Usually due to missing parameters, or invalid parameters."- },- "401": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- },- "required": [- "message"- ]- }- }- },- "description": "Unauthorized. Due to missing or invalid authentication."- },- "403": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Forbidden. You do not have permission to access this resource or to perform this action."- },- "404": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Not Found. The requested resource was not found."- },- "429": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Too Many Requests. You have exceeded the rate limit. Try again later."- },- "500": {- "content": {- "application/json": {- "schema": {- "type": "object",- "properties": {- "message": {- "type": "string"- }- }- }- }- },- "description": "Internal Server Error. This is a problem with the server that you cannot fix."- }- },- "operationId": "hasOrganizationPermission",- "summary": "Check Organization Permission"- }- }- },- "tags": [- {- "name": "Organization Management"- }- ]-}diff --git a/apps/web/src/components/activity/comment-editor.tsx b/apps/web/src/components/activity/comment-editor.tsxindex affe576aa..feee77523 100644--- a/apps/web/src/components/activity/comment-editor.tsx+++ b/apps/web/src/components/activity/comment-editor.tsx@@ -1,5 +1,6 @@import type { Editor } from "@tiptap/core";import Image from "@tiptap/extension-image";+import Link from "@tiptap/extension-link";import Placeholder from "@tiptap/extension-placeholder";import { Table } from "@tiptap/extension-table";import TableCell from "@tiptap/extension-table-cell";@@ -146,6 +147,7 @@ type EmbedComposerState = {url: string;top: number;left: number;+ linkRange?: { from: number; to: number };range?: SlashRange;};@@ -550,11 +552,12 @@ export default function CommentEditor({codeBlock: {HTMLAttributes: { class: "kaneo-tiptap-codeblock" },},- link: {- autolink: true,- defaultProtocol: "https",- openOnClick: readOnly,- },+ }),+ Link.configure({+ autolink: true,+ defaultProtocol: "https",+ linkOnPaste: true,+ openOnClick: readOnly,}),Markdown.configure({markedOptions: {@@ -651,12 +654,24 @@ export default function CommentEditor({if (!isYouTubeUrl(url)) return false;event.preventDefault();+ const { from } = view.state.selection;+ const linkMark = view.state.schema.marks.link?.create({ href: url });+ const linkText = view.state.schema.text(+ url,+ linkMark ? [linkMark] : [],+ );+ view.dispatch(+ view.state.tr+ .replaceSelectionWith(linkText, false)+ .scrollIntoView(),+ );const coords = getOverlayPosition(view, view.state.selection.from);setEmbedComposer({mode: "choice",url,top: coords.top,left: coords.left,+ linkRange: { from, to: from + url.length },});setEmbedComposerError("");return true;@@ -682,6 +697,38 @@ export default function CommentEditor({void handleAssetFileUpload(droppedFile, editor, dropRange);return true;},+ handleTextInput: (view, _from, _to, text) => {+ if (readOnly || disabled || text !== "`") return false;++ const { state } = view;+ const { $from } = state.selection;+ if ($from.parent.type.name !== "paragraph") return false;++ const textBefore = $from.parent.textBetween(+ 0,+ $from.parentOffset,+ "\0",+ "\0",+ );++ if (!/^\s*``$/.test(textBefore)) return false;++ const paragraphStart = $from.before();+ const codeBlock = state.schema.nodes.codeBlock?.create();+ if (!codeBlock) return false;++ const tr = state.tr.replaceWith(+ paragraphStart,+ paragraphStart + $from.parent.nodeSize,+ codeBlock,+ );++ tr.setSelection(+ TextSelection.near(tr.doc.resolve(paragraphStart + 1)),+ );+ view.dispatch(tr.scrollIntoView());+ return true;+ },handleKeyDown: (_view, event) => {if (!readOnly && !disabled && slashMenu) {if (event.key === "ArrowDown") {@@ -1132,12 +1179,33 @@ export default function CommentEditor({}const chain = editor.chain().focus();- if (embedComposer.range) {+ if (embedComposer.mode === "choice" && mode === "link") {+ setEmbedComposer(null);+ setEmbedComposerError("");+ return;+ }++ if (embedComposer.linkRange) {+ chain.deleteRange(embedComposer.linkRange);+ } else if (embedComposer.range) {chain.deleteRange(embedComposer.range);}if (mode === "link") {- chain.insertContent(url).run();+ chain+ .insertContent({+ type: "text",+ text: url,+ marks: [+ {+ type: "link",+ attrs: {+ href: url,+ },+ },+ ],+ })+ .run();} else {if (!isYouTubeUrl(url)) {setEmbedComposerError("Only YouTube links can be embedded.");@@ -1165,8 +1233,15 @@ export default function CommentEditor({const handleKeyDown = (event: KeyboardEvent) => {if (!embedComposer) return;+ event.stopPropagation();+ event.stopImmediatePropagation();if (embedComposer.mode === "choice") {+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {+ event.preventDefault();+ return;+ }+if (event.key === "Tab") {event.preventDefault();submitEmbedComposer("embed");@@ -1175,7 +1250,8 @@ export default function CommentEditor({if (event.key === "Escape") {event.preventDefault();- submitEmbedComposer("link");+ setEmbedComposer(null);+ setEmbedComposerError("");return;}@@ -1586,7 +1662,8 @@ export default function CommentEditor({className="kaneo-embed-choice-item"onMouseDown={(event) => {event.preventDefault();- submitEmbedComposer("link");+ setEmbedComposer(null);+ setEmbedComposerError("");}}><span>Keep as link</span>diff --git a/apps/web/src/components/task/task-description.tsx b/apps/web/src/components/task/task-description.tsxindex 9da198718..a791e2477 100644--- a/apps/web/src/components/task/task-description.tsx+++ b/apps/web/src/components/task/task-description.tsx@@ -1,5 +1,6 @@import type { Editor } from "@tiptap/core";import Image from "@tiptap/extension-image";+import Link from "@tiptap/extension-link";import Placeholder from "@tiptap/extension-placeholder";import { Table } from "@tiptap/extension-table";import TableCell from "@tiptap/extension-table-cell";@@ -112,6 +113,7 @@ type EmbedComposerState = {url: string;top: number;left: number;+ linkRange?: { from: number; to: number };range?: SlashRange;};@@ -524,11 +526,12 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {},trailingNode: false,heading: { levels: [1, 2, 3] },- link: {- autolink: true,- defaultProtocol: "https",- openOnClick: false,- },+ }),+ Link.configure({+ autolink: true,+ defaultProtocol: "https",+ linkOnPaste: true,+ openOnClick: false,}),Markdown.configure({markedOptions: {@@ -620,6 +623,17 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {if (!isYouTubeUrl(url)) return false;event.preventDefault();+ const { from } = view.state.selection;+ const linkMark = view.state.schema.marks.link?.create({ href: url });+ const linkText = view.state.schema.text(+ url,+ linkMark ? [linkMark] : [],+ );+ view.dispatch(+ view.state.tr+ .replaceSelectionWith(linkText, false)+ .scrollIntoView(),+ );const coords = getOverlayPosition(view, view.state.selection.from);setEmbedComposer({@@ -627,6 +641,7 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {url,top: coords.top,left: coords.left,+ linkRange: { from, to: from + url.length },});setEmbedComposerError("");return true;@@ -649,6 +664,38 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {void handleAssetFileUpload(droppedFile, editor, dropRange);return true;},+ handleTextInput: (view, _from, _to, text) => {+ if (text !== "`") return false;++ const { state } = view;+ const { $from } = state.selection;+ if ($from.parent.type.name !== "paragraph") return false;++ const textBefore = $from.parent.textBetween(+ 0,+ $from.parentOffset,+ "\0",+ "\0",+ );++ if (!/^\s*``$/.test(textBefore)) return false;++ const paragraphStart = $from.before();+ const codeBlock = state.schema.nodes.codeBlock?.create();+ if (!codeBlock) return false;++ const tr = state.tr.replaceWith(+ paragraphStart,+ paragraphStart + $from.parent.nodeSize,+ codeBlock,+ );++ tr.setSelection(+ TextSelection.near(tr.doc.resolve(paragraphStart + 1)),+ );+ view.dispatch(tr.scrollIntoView());+ return true;+ },handleKeyDown: (view, event) => {if (!(@@ -937,12 +984,33 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {}const chain = editor.chain().focus();- if (embedComposer.range) {+ if (embedComposer.mode === "choice" && mode === "link") {+ setEmbedComposer(null);+ setEmbedComposerError("");+ return;+ }++ if (embedComposer.linkRange) {+ chain.deleteRange(embedComposer.linkRange);+ } else if (embedComposer.range) {chain.deleteRange(embedComposer.range);}if (mode === "link") {- chain.insertContent(url).run();+ chain+ .insertContent({+ type: "text",+ text: url,+ marks: [+ {+ type: "link",+ attrs: {+ href: url,+ },+ },+ ],+ })+ .run();} else {if (!isYouTubeUrl(url)) {setEmbedComposerError("Only YouTube links can be embedded.");@@ -968,6 +1036,16 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {useEffect(() => {const handleKeyDown = (event: KeyboardEvent) => {if (embedComposer) {+ event.stopPropagation();+ event.stopImmediatePropagation();++ if (embedComposer.mode === "choice") {+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {+ event.preventDefault();+ return;+ }+ }+if (event.key === "Tab") {event.preventDefault();submitEmbedComposer("embed");@@ -975,17 +1053,15 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {}if (event.key === "Enter") {event.preventDefault();- submitEmbedComposer("link");+ submitEmbedComposer(+ embedComposer.mode === "choice" ? "embed" : "link",+ );return;}if (event.key === "Escape") {event.preventDefault();- if (embedComposer.mode === "choice") {- submitEmbedComposer("link");- } else {- setEmbedComposer(null);- setEmbedComposerError("");- }+ setEmbedComposer(null);+ setEmbedComposerError("");}return;}@@ -1578,7 +1654,8 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {className="kaneo-embed-choice-item"onMouseDown={(event) => {event.preventDefault();- submitEmbedComposer("link");+ setEmbedComposer(null);+ setEmbedComposerError("");}}><span>Keep as link</span>diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex e9538f8a2..582959b9d 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -868,7 +868,7 @@ input:-webkit-autofill:active {.kaneo-embed-composer {position: fixed;z-index: 60;- width: min(24rem, calc(100vw - 2rem));+ width: min(16.5rem, calc(100vw - 2rem));border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);border-radius: 0.6rem;background: var(--popover);@@ -886,7 +886,7 @@ input:-webkit-autofill:active {.kaneo-embed-choice-menu {display: flex;- min-width: 10.5rem;+ min-width: 0;flex-direction: column;gap: 0.2rem;}@@ -1106,8 +1106,10 @@ input:-webkit-autofill:active {text-decoration: line-through;}- .kaneo-comment-editor-prose a {+ .kaneo-comment-editor-prose a,+ .kaneo-tiptap-prose a {color: color-mix(in srgb, var(--foreground) 88%, #4c9aff 12%);+ cursor: pointer;text-decoration: underline;text-decoration-color: color-mix(in srgb, var(--ring) 44%, transparent);text-underline-offset: 2px;