From 1af82f6686a38b737a04a963e965deecf28f9828 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 29 Dec 2022 18:46:36 +0100 Subject: [PATCH] chore: generate swagger docs --- pkg/swagger/docs.go | 1206 +++----------------------------------- pkg/swagger/swagger.json | 1206 +++----------------------------------- pkg/swagger/swagger.yaml | 827 ++------------------------ 3 files changed, 213 insertions(+), 3026 deletions(-) diff --git a/pkg/swagger/docs.go b/pkg/swagger/docs.go index ec977e041..8daf277a9 100644 --- a/pkg/swagger/docs.go +++ b/pkg/swagger/docs.go @@ -1234,947 +1234,6 @@ const docTemplate = `{ } } }, - "/namespace/{id}": { - "post": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Updates a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Updates a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "The namespace with updated values you want to update.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.Namespace" - } - } - ], - "responses": { - "200": { - "description": "The updated namespace.", - "schema": { - "$ref": "#/definitions/models.Namespace" - } - }, - "400": { - "description": "Invalid namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns all namespaces a user has access to.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Get all namespaces a user has access to", - "parameters": [ - { - "type": "integer", - "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", - "name": "per_page", - "in": "query" - }, - { - "type": "string", - "description": "Search namespaces by name.", - "name": "s", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, also returns all archived namespaces.", - "name": "is_archived", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, also returns only namespaces without their projects.", - "name": "namespaces_only", - "in": "query" - } - ], - "responses": { - "200": { - "description": "The Namespaces.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.NamespaceWithProjects" - } - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Creates a new namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Creates a new namespace", - "parameters": [ - { - "description": "The namespace you want to create.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.Namespace" - } - } - ], - "responses": { - "201": { - "description": "The created namespace.", - "schema": { - "$ref": "#/definitions/models.Namespace" - } - }, - "400": { - "description": "Invalid namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns a namespace by its ID.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Gets one namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The Namespace", - "schema": { - "$ref": "#/definitions/models.Namespace" - } - }, - "403": { - "description": "The user does not have access to that namespace.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "delete": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Delets a namespace", - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Deletes a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The namespace was successfully deleted.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "400": { - "description": "Invalid namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}/projects": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns all projects inside of a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Get all projects in a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The projects.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.Project" - } - } - }, - "403": { - "description": "No access to that namespace.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "404": { - "description": "The namespace does not exist.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}/teams": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns a namespace with all teams which have access on a given namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Get teams on a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", - "name": "per_page", - "in": "query" - }, - { - "type": "string", - "description": "Search teams by its name.", - "name": "s", - "in": "query" - } - ], - "responses": { - "200": { - "description": "The teams with the right they have.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.TeamWithRight" - } - } - }, - "403": { - "description": "No right to see the namespace.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Gives a team access to a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Add a team to a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "The team you want to add to the namespace.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - } - ], - "responses": { - "201": { - "description": "The created team\u003c-\u003enamespace relation.", - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - }, - "400": { - "description": "Invalid team namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The team does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "The team does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}/users": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns a namespace with all users which have access on a given namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Get users on a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", - "name": "per_page", - "in": "query" - }, - { - "type": "string", - "description": "Search users by its name.", - "name": "s", - "in": "query" - } - ], - "responses": { - "200": { - "description": "The users with the right they have.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.UserWithRight" - } - } - }, - "403": { - "description": "No right to see the namespace.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Gives a user access to a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Add a user to a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "The user you want to add to the namespace.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - } - ], - "responses": { - "201": { - "description": "The created user\u003c-\u003enamespace relation.", - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - }, - "400": { - "description": "Invalid user namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "The user does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{namespaceID}/projects": { - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Creates a new project in a given namespace. The user needs write-access to the namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "project" - ], - "summary": "Creates a new project", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "description": "The project you want to create.", - "name": "project", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.Project" - } - } - ], - "responses": { - "201": { - "description": "The created project.", - "schema": { - "$ref": "#/definitions/models.Project" - } - }, - "400": { - "description": "Invalid project object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the project", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{namespaceID}/teams/{teamID}": { - "post": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Update a team \u003c-\u003e namespace relation. Mostly used to update the right that team has.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Update a team \u003c-\u003e namespace relation", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Team ID", - "name": "teamID", - "in": "path", - "required": true - }, - { - "description": "The team you want to update.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - } - ], - "responses": { - "200": { - "description": "The updated team \u003c-\u003e namespace relation.", - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - }, - "403": { - "description": "The team does not have admin-access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "Team or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "delete": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Delets a team from a namespace. The team won't have access to the namespace anymore.", - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Delete a team from a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "team ID", - "name": "teamID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The team was successfully deleted.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "403": { - "description": "The team does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "team or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{namespaceID}/users/{userID}": { - "post": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Update a user \u003c-\u003e namespace relation. Mostly used to update the right that user has.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Update a user \u003c-\u003e namespace relation", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "User ID", - "name": "userID", - "in": "path", - "required": true - }, - { - "description": "The user you want to update.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - } - ], - "responses": { - "200": { - "description": "The updated user \u003c-\u003e namespace relation.", - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - }, - "403": { - "description": "The user does not have admin-access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "User or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "delete": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Delets a user from a namespace. The user won't have access to the namespace anymore.", - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Delete a user from a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "user ID", - "name": "userID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The user was successfully deleted.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "user or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, "/notifications": { "get": { "security": [ @@ -2354,6 +1413,61 @@ const docTemplate = `{ } } } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new project. If a parent project is provided the user needs to have write access to that project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Creates a new project", + "parameters": [ + { + "description": "The project you want to create.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Project" + } + } + ], + "responses": { + "201": { + "description": "The created project.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } } }, "/projects/{id}": { @@ -3441,7 +2555,7 @@ const docTemplate = `{ "JWTKeyAuth": [] } ], - "description": "Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one project to a new namespace. The user needs read access in the project and write access in the namespace of the new project.", + "description": "Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one project to a new one. The user needs read access in the project and write access in the parent of the new project.", "consumes": [ "application/json" ], @@ -3461,7 +2575,7 @@ const docTemplate = `{ "required": true }, { - "description": "The target namespace which should hold the copied project.", + "description": "The target parent project which should hold the copied project.", "name": "project", "in": "body", "required": true, @@ -3484,7 +2598,7 @@ const docTemplate = `{ } }, "403": { - "description": "The user does not have access to the project or namespace", + "description": "The user does not have access to the project or its parent.", "schema": { "$ref": "#/definitions/web.HTTPError" } @@ -4234,7 +3348,7 @@ const docTemplate = `{ "parameters": [ { "type": "string", - "description": "The entity the user subscribes to. Can be either ` + "`" + `namespace` + "`" + `, ` + "`" + `project` + "`" + ` or ` + "`" + `task` + "`" + `.", + "description": "The entity the user subscribes to. Can be either ` + "`" + `project` + "`" + ` or ` + "`" + `task` + "`" + `.", "name": "entity", "in": "path", "required": true @@ -4294,7 +3408,7 @@ const docTemplate = `{ "parameters": [ { "type": "string", - "description": "The entity the user subscribed to. Can be either ` + "`" + `namespace` + "`" + `, ` + "`" + `project` + "`" + ` or ` + "`" + `task` + "`" + `.", + "description": "The entity the user subscribed to. Can be either ` + "`" + `project` + "`" + ` or ` + "`" + `task` + "`" + `.", "name": "entity", "in": "path", "required": true @@ -5870,7 +4984,7 @@ const docTemplate = `{ "JWTKeyAuth": [] } ], - "description": "Creates a new team in a given namespace. The user needs write-access to the namespace.", + "description": "Creates a new team.", "consumes": [ "application/json" ], @@ -7998,147 +7112,6 @@ const docTemplate = `{ } } }, - "models.Namespace": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this namespace was created. You cannot change this value.", - "type": "string" - }, - "description": { - "description": "The description of the namespace", - "type": "string" - }, - "hex_color": { - "description": "The hex color of this namespace", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this namespace.", - "type": "integer" - }, - "is_archived": { - "description": "Whether or not a namespace is archived.", - "type": "boolean" - }, - "owner": { - "description": "The user who owns this namespace", - "allOf": [ - { - "$ref": "#/definitions/user.User" - } - ] - }, - "subscription": { - "description": "The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retreiving one namespace.", - "allOf": [ - { - "$ref": "#/definitions/models.Subscription" - } - ] - }, - "title": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 1 - }, - "updated": { - "description": "A timestamp when this namespace was last updated. You cannot change this value.", - "type": "string" - } - } - }, - "models.NamespaceUser": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this relation was created. You cannot change this value.", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this namespace \u003c-\u003e user relation.", - "type": "integer" - }, - "right": { - "description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "default": 0, - "maximum": 2, - "allOf": [ - { - "$ref": "#/definitions/models.Right" - } - ] - }, - "updated": { - "description": "A timestamp when this relation was last updated. You cannot change this value.", - "type": "string" - }, - "user_id": { - "description": "The username.", - "type": "string" - } - } - }, - "models.NamespaceWithProjects": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this namespace was created. You cannot change this value.", - "type": "string" - }, - "description": { - "description": "The description of the namespace", - "type": "string" - }, - "hex_color": { - "description": "The hex color of this namespace", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this namespace.", - "type": "integer" - }, - "is_archived": { - "description": "Whether or not a namespace is archived.", - "type": "boolean" - }, - "owner": { - "description": "The user who owns this namespace", - "allOf": [ - { - "$ref": "#/definitions/user.User" - } - ] - }, - "projects": { - "type": "array", - "items": { - "$ref": "#/definitions/models.Project" - } - }, - "subscription": { - "description": "The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retreiving one namespace.", - "allOf": [ - { - "$ref": "#/definitions/models.Subscription" - } - ] - }, - "title": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 1 - }, - "updated": { - "description": "A timestamp when this namespace was last updated. You cannot change this value.", - "type": "string" - } - } - }, "models.Project": { "type": "object", "properties": { @@ -8149,6 +7122,12 @@ const docTemplate = `{ "background_information": { "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background" }, + "child_projects": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Project" + } + }, "created": { "description": "A timestamp when this project was created. You cannot change this value.", "type": "string" @@ -8173,16 +7152,13 @@ const docTemplate = `{ "minLength": 0 }, "is_archived": { - "description": "Whether or not a project is archived.", + "description": "Whether a project is archived.", "type": "boolean" }, "is_favorite": { - "description": "True if a project is a favorite. Favorite projects show up in a separate namespace. This value depends on the user making the call to the api.", + "description": "True if a project is a favorite. Favorite projects show up in a separate parent project. This value depends on the user making the call to the api.", "type": "boolean" }, - "namespace_id": { - "type": "integer" - }, "owner": { "description": "The user who created this project.", "allOf": [ @@ -8191,6 +7167,9 @@ const docTemplate = `{ } ] }, + "parent_project_id": { + "type": "integer" + }, "position": { "description": "The position this project has when querying all projects. See the tasks.position property on how to use this.", "type": "number" @@ -8204,7 +7183,7 @@ const docTemplate = `{ ] }, "title": { - "description": "The title of the project. You'll see this in the namespace overview.", + "description": "The title of the project. You'll see this in the overview.", "type": "string", "maxLength": 250, "minLength": 1 @@ -8218,8 +7197,8 @@ const docTemplate = `{ "models.ProjectDuplicate": { "type": "object", "properties": { - "namespace_id": { - "description": "The target namespace ID", + "parent_project_id": { + "description": "The target parent project", "type": "integer" }, "project": { @@ -8340,7 +7319,7 @@ const docTemplate = `{ "type": "integer" }, "is_favorite": { - "description": "True if the filter is a favorite. Favorite filters show up in a separate namespace together with favorite projects.", + "description": "True if the filter is a favorite. Favorite filters show up in a separate parent project together with favorite projects.", "type": "boolean" }, "owner": { @@ -8767,37 +7746,6 @@ const docTemplate = `{ } } }, - "models.TeamNamespace": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this relation was created. You cannot change this value.", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this namespace \u003c-\u003e team relation.", - "type": "integer" - }, - "right": { - "description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "default": 0, - "maximum": 2, - "allOf": [ - { - "$ref": "#/definitions/models.Right" - } - ] - }, - "team_id": { - "description": "The team id.", - "type": "integer" - }, - "updated": { - "description": "A timestamp when this relation was last updated. You cannot change this value.", - "type": "string" - } - } - }, "models.TeamProject": { "type": "object", "properties": { @@ -9403,7 +8351,7 @@ var SwaggerInfo = &swag.Spec{ BasePath: "/api/v1", Schemes: []string{}, Title: "Vikunja API", - Description: "# Pagination\nEvery endpoint capable of pagination will return two headers:\n* `x-pagination-total-pages`: The total number of available pages for this request\n* `x-pagination-result-count`: The number of items returned for this request.\n# Rights\nAll endpoints which return a single item (project, task, namespace, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based on the rights the user has.\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n", + Description: "# Pagination\nEvery endpoint capable of pagination will return two headers:\n* `x-pagination-total-pages`: The total number of available pages for this request\n* `x-pagination-result-count`: The number of items returned for this request.\n# Rights\nAll endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based on the rights the user has.\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, } diff --git a/pkg/swagger/swagger.json b/pkg/swagger/swagger.json index 7bf9436b2..18c1374a2 100644 --- a/pkg/swagger/swagger.json +++ b/pkg/swagger/swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "description": "# Pagination\nEvery endpoint capable of pagination will return two headers:\n* `x-pagination-total-pages`: The total number of available pages for this request\n* `x-pagination-result-count`: The number of items returned for this request.\n# Rights\nAll endpoints which return a single item (project, task, namespace, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read \u0026 Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based on the rights the user has.\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer \u003cjwt-token\u003e`-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e", + "description": "# Pagination\nEvery endpoint capable of pagination will return two headers:\n* `x-pagination-total-pages`: The total number of available pages for this request\n* `x-pagination-result-count`: The number of items returned for this request.\n# Rights\nAll endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read \u0026 Write` and `2` is `Admin`.\nThis can be used to show or hide ui elements based on the rights the user has.\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer \u003cjwt-token\u003e`-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e", "title": "Vikunja API", "contact": { "name": "General Vikunja contact", @@ -1225,947 +1225,6 @@ } } }, - "/namespace/{id}": { - "post": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Updates a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Updates a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "The namespace with updated values you want to update.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.Namespace" - } - } - ], - "responses": { - "200": { - "description": "The updated namespace.", - "schema": { - "$ref": "#/definitions/models.Namespace" - } - }, - "400": { - "description": "Invalid namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns all namespaces a user has access to.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Get all namespaces a user has access to", - "parameters": [ - { - "type": "integer", - "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", - "name": "per_page", - "in": "query" - }, - { - "type": "string", - "description": "Search namespaces by name.", - "name": "s", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, also returns all archived namespaces.", - "name": "is_archived", - "in": "query" - }, - { - "type": "boolean", - "description": "If true, also returns only namespaces without their projects.", - "name": "namespaces_only", - "in": "query" - } - ], - "responses": { - "200": { - "description": "The Namespaces.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.NamespaceWithProjects" - } - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Creates a new namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Creates a new namespace", - "parameters": [ - { - "description": "The namespace you want to create.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.Namespace" - } - } - ], - "responses": { - "201": { - "description": "The created namespace.", - "schema": { - "$ref": "#/definitions/models.Namespace" - } - }, - "400": { - "description": "Invalid namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns a namespace by its ID.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Gets one namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The Namespace", - "schema": { - "$ref": "#/definitions/models.Namespace" - } - }, - "403": { - "description": "The user does not have access to that namespace.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "delete": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Delets a namespace", - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Deletes a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The namespace was successfully deleted.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "400": { - "description": "Invalid namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}/projects": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns all projects inside of a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "Get all projects in a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The projects.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.Project" - } - } - }, - "403": { - "description": "No access to that namespace.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "404": { - "description": "The namespace does not exist.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}/teams": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns a namespace with all teams which have access on a given namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Get teams on a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", - "name": "per_page", - "in": "query" - }, - { - "type": "string", - "description": "Search teams by its name.", - "name": "s", - "in": "query" - } - ], - "responses": { - "200": { - "description": "The teams with the right they have.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.TeamWithRight" - } - } - }, - "403": { - "description": "No right to see the namespace.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Gives a team access to a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Add a team to a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "The team you want to add to the namespace.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - } - ], - "responses": { - "201": { - "description": "The created team\u003c-\u003enamespace relation.", - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - }, - "400": { - "description": "Invalid team namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The team does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "The team does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{id}/users": { - "get": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Returns a namespace with all users which have access on a given namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Get users on a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "The page number. Used for pagination. If not provided, the first page of results is returned.", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page.", - "name": "per_page", - "in": "query" - }, - { - "type": "string", - "description": "Search users by its name.", - "name": "s", - "in": "query" - } - ], - "responses": { - "200": { - "description": "The users with the right they have.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/models.UserWithRight" - } - } - }, - "403": { - "description": "No right to see the namespace.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Gives a user access to a namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Add a user to a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "The user you want to add to the namespace.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - } - ], - "responses": { - "201": { - "description": "The created user\u003c-\u003enamespace relation.", - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - }, - "400": { - "description": "Invalid user namespace object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "The user does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{namespaceID}/projects": { - "put": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Creates a new project in a given namespace. The user needs write-access to the namespace.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "project" - ], - "summary": "Creates a new project", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "description": "The project you want to create.", - "name": "project", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.Project" - } - } - ], - "responses": { - "201": { - "description": "The created project.", - "schema": { - "$ref": "#/definitions/models.Project" - } - }, - "400": { - "description": "Invalid project object provided.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "403": { - "description": "The user does not have access to the project", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{namespaceID}/teams/{teamID}": { - "post": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Update a team \u003c-\u003e namespace relation. Mostly used to update the right that team has.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Update a team \u003c-\u003e namespace relation", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Team ID", - "name": "teamID", - "in": "path", - "required": true - }, - { - "description": "The team you want to update.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - } - ], - "responses": { - "200": { - "description": "The updated team \u003c-\u003e namespace relation.", - "schema": { - "$ref": "#/definitions/models.TeamNamespace" - } - }, - "403": { - "description": "The team does not have admin-access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "Team or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "delete": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Delets a team from a namespace. The team won't have access to the namespace anymore.", - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Delete a team from a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "team ID", - "name": "teamID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The team was successfully deleted.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "403": { - "description": "The team does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "team or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, - "/namespaces/{namespaceID}/users/{userID}": { - "post": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Update a user \u003c-\u003e namespace relation. Mostly used to update the right that user has.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Update a user \u003c-\u003e namespace relation", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "User ID", - "name": "userID", - "in": "path", - "required": true - }, - { - "description": "The user you want to update.", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - } - ], - "responses": { - "200": { - "description": "The updated user \u003c-\u003e namespace relation.", - "schema": { - "$ref": "#/definitions/models.NamespaceUser" - } - }, - "403": { - "description": "The user does not have admin-access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "User or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - }, - "delete": { - "security": [ - { - "JWTKeyAuth": [] - } - ], - "description": "Delets a user from a namespace. The user won't have access to the namespace anymore.", - "produces": [ - "application/json" - ], - "tags": [ - "sharing" - ], - "summary": "Delete a user from a namespace", - "parameters": [ - { - "type": "integer", - "description": "Namespace ID", - "name": "namespaceID", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "user ID", - "name": "userID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "The user was successfully deleted.", - "schema": { - "$ref": "#/definitions/models.Message" - } - }, - "403": { - "description": "The user does not have access to the namespace", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "404": { - "description": "user or namespace does not exist.", - "schema": { - "$ref": "#/definitions/web.HTTPError" - } - }, - "500": { - "description": "Internal error", - "schema": { - "$ref": "#/definitions/models.Message" - } - } - } - } - }, "/notifications": { "get": { "security": [ @@ -2345,6 +1404,61 @@ } } } + }, + "put": { + "security": [ + { + "JWTKeyAuth": [] + } + ], + "description": "Creates a new project. If a parent project is provided the user needs to have write access to that project.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "project" + ], + "summary": "Creates a new project", + "parameters": [ + { + "description": "The project you want to create.", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.Project" + } + } + ], + "responses": { + "201": { + "description": "The created project.", + "schema": { + "$ref": "#/definitions/models.Project" + } + }, + "400": { + "description": "Invalid project object provided.", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "403": { + "description": "The user does not have access to the project", + "schema": { + "$ref": "#/definitions/web.HTTPError" + } + }, + "500": { + "description": "Internal error", + "schema": { + "$ref": "#/definitions/models.Message" + } + } + } } }, "/projects/{id}": { @@ -3432,7 +2546,7 @@ "JWTKeyAuth": [] } ], - "description": "Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one project to a new namespace. The user needs read access in the project and write access in the namespace of the new project.", + "description": "Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares from one project to a new one. The user needs read access in the project and write access in the parent of the new project.", "consumes": [ "application/json" ], @@ -3452,7 +2566,7 @@ "required": true }, { - "description": "The target namespace which should hold the copied project.", + "description": "The target parent project which should hold the copied project.", "name": "project", "in": "body", "required": true, @@ -3475,7 +2589,7 @@ } }, "403": { - "description": "The user does not have access to the project or namespace", + "description": "The user does not have access to the project or its parent.", "schema": { "$ref": "#/definitions/web.HTTPError" } @@ -4225,7 +3339,7 @@ "parameters": [ { "type": "string", - "description": "The entity the user subscribes to. Can be either `namespace`, `project` or `task`.", + "description": "The entity the user subscribes to. Can be either `project` or `task`.", "name": "entity", "in": "path", "required": true @@ -4285,7 +3399,7 @@ "parameters": [ { "type": "string", - "description": "The entity the user subscribed to. Can be either `namespace`, `project` or `task`.", + "description": "The entity the user subscribed to. Can be either `project` or `task`.", "name": "entity", "in": "path", "required": true @@ -5861,7 +4975,7 @@ "JWTKeyAuth": [] } ], - "description": "Creates a new team in a given namespace. The user needs write-access to the namespace.", + "description": "Creates a new team.", "consumes": [ "application/json" ], @@ -7989,147 +7103,6 @@ } } }, - "models.Namespace": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this namespace was created. You cannot change this value.", - "type": "string" - }, - "description": { - "description": "The description of the namespace", - "type": "string" - }, - "hex_color": { - "description": "The hex color of this namespace", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this namespace.", - "type": "integer" - }, - "is_archived": { - "description": "Whether or not a namespace is archived.", - "type": "boolean" - }, - "owner": { - "description": "The user who owns this namespace", - "allOf": [ - { - "$ref": "#/definitions/user.User" - } - ] - }, - "subscription": { - "description": "The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retreiving one namespace.", - "allOf": [ - { - "$ref": "#/definitions/models.Subscription" - } - ] - }, - "title": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 1 - }, - "updated": { - "description": "A timestamp when this namespace was last updated. You cannot change this value.", - "type": "string" - } - } - }, - "models.NamespaceUser": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this relation was created. You cannot change this value.", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this namespace \u003c-\u003e user relation.", - "type": "integer" - }, - "right": { - "description": "The right this user has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "default": 0, - "maximum": 2, - "allOf": [ - { - "$ref": "#/definitions/models.Right" - } - ] - }, - "updated": { - "description": "A timestamp when this relation was last updated. You cannot change this value.", - "type": "string" - }, - "user_id": { - "description": "The username.", - "type": "string" - } - } - }, - "models.NamespaceWithProjects": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this namespace was created. You cannot change this value.", - "type": "string" - }, - "description": { - "description": "The description of the namespace", - "type": "string" - }, - "hex_color": { - "description": "The hex color of this namespace", - "type": "string", - "maxLength": 6 - }, - "id": { - "description": "The unique, numeric id of this namespace.", - "type": "integer" - }, - "is_archived": { - "description": "Whether or not a namespace is archived.", - "type": "boolean" - }, - "owner": { - "description": "The user who owns this namespace", - "allOf": [ - { - "$ref": "#/definitions/user.User" - } - ] - }, - "projects": { - "type": "array", - "items": { - "$ref": "#/definitions/models.Project" - } - }, - "subscription": { - "description": "The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it.\nWill only returned when retreiving one namespace.", - "allOf": [ - { - "$ref": "#/definitions/models.Subscription" - } - ] - }, - "title": { - "description": "The name of this namespace.", - "type": "string", - "maxLength": 250, - "minLength": 1 - }, - "updated": { - "description": "A timestamp when this namespace was last updated. You cannot change this value.", - "type": "string" - } - } - }, "models.Project": { "type": "object", "properties": { @@ -8140,6 +7113,12 @@ "background_information": { "description": "Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background" }, + "child_projects": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Project" + } + }, "created": { "description": "A timestamp when this project was created. You cannot change this value.", "type": "string" @@ -8164,16 +7143,13 @@ "minLength": 0 }, "is_archived": { - "description": "Whether or not a project is archived.", + "description": "Whether a project is archived.", "type": "boolean" }, "is_favorite": { - "description": "True if a project is a favorite. Favorite projects show up in a separate namespace. This value depends on the user making the call to the api.", + "description": "True if a project is a favorite. Favorite projects show up in a separate parent project. This value depends on the user making the call to the api.", "type": "boolean" }, - "namespace_id": { - "type": "integer" - }, "owner": { "description": "The user who created this project.", "allOf": [ @@ -8182,6 +7158,9 @@ } ] }, + "parent_project_id": { + "type": "integer" + }, "position": { "description": "The position this project has when querying all projects. See the tasks.position property on how to use this.", "type": "number" @@ -8195,7 +7174,7 @@ ] }, "title": { - "description": "The title of the project. You'll see this in the namespace overview.", + "description": "The title of the project. You'll see this in the overview.", "type": "string", "maxLength": 250, "minLength": 1 @@ -8209,8 +7188,8 @@ "models.ProjectDuplicate": { "type": "object", "properties": { - "namespace_id": { - "description": "The target namespace ID", + "parent_project_id": { + "description": "The target parent project", "type": "integer" }, "project": { @@ -8331,7 +7310,7 @@ "type": "integer" }, "is_favorite": { - "description": "True if the filter is a favorite. Favorite filters show up in a separate namespace together with favorite projects.", + "description": "True if the filter is a favorite. Favorite filters show up in a separate parent project together with favorite projects.", "type": "boolean" }, "owner": { @@ -8758,37 +7737,6 @@ } } }, - "models.TeamNamespace": { - "type": "object", - "properties": { - "created": { - "description": "A timestamp when this relation was created. You cannot change this value.", - "type": "string" - }, - "id": { - "description": "The unique, numeric id of this namespace \u003c-\u003e team relation.", - "type": "integer" - }, - "right": { - "description": "The right this team has. 0 = Read only, 1 = Read \u0026 Write, 2 = Admin. See the docs for more details.", - "default": 0, - "maximum": 2, - "allOf": [ - { - "$ref": "#/definitions/models.Right" - } - ] - }, - "team_id": { - "description": "The team id.", - "type": "integer" - }, - "updated": { - "description": "A timestamp when this relation was last updated. You cannot change this value.", - "type": "string" - } - } - }, "models.TeamProject": { "type": "object", "properties": { diff --git a/pkg/swagger/swagger.yaml b/pkg/swagger/swagger.yaml index b8c5fe4b5..4ceeaf3d9 100644 --- a/pkg/swagger/swagger.yaml +++ b/pkg/swagger/swagger.yaml @@ -358,112 +358,6 @@ definitions: description: A standard message. type: string type: object - models.Namespace: - properties: - created: - description: A timestamp when this namespace was created. You cannot change - this value. - type: string - description: - description: The description of the namespace - type: string - hex_color: - description: The hex color of this namespace - maxLength: 6 - type: string - id: - description: The unique, numeric id of this namespace. - type: integer - is_archived: - description: Whether or not a namespace is archived. - type: boolean - owner: - allOf: - - $ref: '#/definitions/user.User' - description: The user who owns this namespace - subscription: - allOf: - - $ref: '#/definitions/models.Subscription' - description: |- - The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it. - Will only returned when retreiving one namespace. - title: - description: The name of this namespace. - maxLength: 250 - minLength: 1 - type: string - updated: - description: A timestamp when this namespace was last updated. You cannot - change this value. - type: string - type: object - models.NamespaceUser: - properties: - created: - description: A timestamp when this relation was created. You cannot change - this value. - type: string - id: - description: The unique, numeric id of this namespace <-> user relation. - type: integer - right: - allOf: - - $ref: '#/definitions/models.Right' - default: 0 - description: The right this user has. 0 = Read only, 1 = Read & Write, 2 = - Admin. See the docs for more details. - maximum: 2 - updated: - description: A timestamp when this relation was last updated. You cannot change - this value. - type: string - user_id: - description: The username. - type: string - type: object - models.NamespaceWithProjects: - properties: - created: - description: A timestamp when this namespace was created. You cannot change - this value. - type: string - description: - description: The description of the namespace - type: string - hex_color: - description: The hex color of this namespace - maxLength: 6 - type: string - id: - description: The unique, numeric id of this namespace. - type: integer - is_archived: - description: Whether or not a namespace is archived. - type: boolean - owner: - allOf: - - $ref: '#/definitions/user.User' - description: The user who owns this namespace - projects: - items: - $ref: '#/definitions/models.Project' - type: array - subscription: - allOf: - - $ref: '#/definitions/models.Subscription' - description: |- - The subscription status for the user reading this namespace. You can only read this property, use the subscription endpoints to modify it. - Will only returned when retreiving one namespace. - title: - description: The name of this namespace. - maxLength: 250 - minLength: 1 - type: string - updated: - description: A timestamp when this namespace was last updated. You cannot - change this value. - type: string - type: object models.Project: properties: background_blur_hash: @@ -475,6 +369,10 @@ definitions: description: Holds extra information about the background set since some background providers require attribution or similar. If not null, the background can be accessed at /projects/{projectID}/background + child_projects: + items: + $ref: '#/definitions/models.Project' + type: array created: description: A timestamp when this project was created. You cannot change this value. @@ -495,19 +393,19 @@ definitions: minLength: 0 type: string is_archived: - description: Whether or not a project is archived. + description: Whether a project is archived. type: boolean is_favorite: description: True if a project is a favorite. Favorite projects show up in - a separate namespace. This value depends on the user making the call to - the api. + a separate parent project. This value depends on the user making the call + to the api. type: boolean - namespace_id: - type: integer owner: allOf: - $ref: '#/definitions/user.User' description: The user who created this project. + parent_project_id: + type: integer position: description: The position this project has when querying all projects. See the tasks.position property on how to use this. @@ -519,7 +417,7 @@ definitions: The subscription status for the user reading this project. You can only read this property, use the subscription endpoints to modify it. Will only returned when retreiving one project. title: - description: The title of the project. You'll see this in the namespace overview. + description: The title of the project. You'll see this in the overview. maxLength: 250 minLength: 1 type: string @@ -530,8 +428,8 @@ definitions: type: object models.ProjectDuplicate: properties: - namespace_id: - description: The target namespace ID + parent_project_id: + description: The target parent project type: integer project: allOf: @@ -624,7 +522,7 @@ definitions: type: integer is_favorite: description: True if the filter is a favorite. Favorite filters show up in - a separate namespace together with favorite projects. + a separate parent project together with favorite projects. type: boolean owner: allOf: @@ -948,30 +846,6 @@ definitions: user id entering. type: string type: object - models.TeamNamespace: - properties: - created: - description: A timestamp when this relation was created. You cannot change - this value. - type: string - id: - description: The unique, numeric id of this namespace <-> team relation. - type: integer - right: - allOf: - - $ref: '#/definitions/models.Right' - default: 0 - description: The right this team has. 0 = Read only, 1 = Read & Write, 2 = - Admin. See the docs for more details. - maximum: 2 - team_id: - description: The team id. - type: integer - updated: - description: A timestamp when this relation was last updated. You cannot change - this value. - type: string - type: object models.TeamProject: properties: created: @@ -1413,7 +1287,7 @@ info: * `x-pagination-total-pages`: The total number of available pages for this request * `x-pagination-result-count`: The number of items returned for this request. # Rights - All endpoints which return a single item (project, task, namespace, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. + All endpoints which return a single item (project, task, etc.) - no array - will also return a `x-max-right` header with the max right the user has on this item as an int where `0` is `Read Only`, `1` is `Read & Write` and `2` is `Admin`. This can be used to show or hide ui elements based on the rights the user has. # Authorization **JWT-Auth:** Main authorization method, used for most of the requests. Needs `Authorization: Bearer `-header to authenticate successfully. @@ -2250,624 +2124,6 @@ paths: summary: Get migration status tags: - migration - /namespace/{id}: - post: - consumes: - - application/json - description: Updates a namespace. - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - - description: The namespace with updated values you want to update. - in: body - name: namespace - required: true - schema: - $ref: '#/definitions/models.Namespace' - produces: - - application/json - responses: - "200": - description: The updated namespace. - schema: - $ref: '#/definitions/models.Namespace' - "400": - description: Invalid namespace object provided. - schema: - $ref: '#/definitions/web.HTTPError' - "403": - description: The user does not have access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Updates a namespace - tags: - - namespace - /namespaces: - get: - consumes: - - application/json - description: Returns all namespaces a user has access to. - parameters: - - description: The page number. Used for pagination. If not provided, the first - page of results is returned. - in: query - name: page - type: integer - - description: The maximum number of items per page. Note this parameter is - limited by the configured maximum of items per page. - in: query - name: per_page - type: integer - - description: Search namespaces by name. - in: query - name: s - type: string - - description: If true, also returns all archived namespaces. - in: query - name: is_archived - type: boolean - - description: If true, also returns only namespaces without their projects. - in: query - name: namespaces_only - type: boolean - produces: - - application/json - responses: - "200": - description: The Namespaces. - schema: - items: - $ref: '#/definitions/models.NamespaceWithProjects' - type: array - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Get all namespaces a user has access to - tags: - - namespace - put: - consumes: - - application/json - description: Creates a new namespace. - parameters: - - description: The namespace you want to create. - in: body - name: namespace - required: true - schema: - $ref: '#/definitions/models.Namespace' - produces: - - application/json - responses: - "201": - description: The created namespace. - schema: - $ref: '#/definitions/models.Namespace' - "400": - description: Invalid namespace object provided. - schema: - $ref: '#/definitions/web.HTTPError' - "403": - description: The user does not have access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Creates a new namespace - tags: - - namespace - /namespaces/{id}: - delete: - description: Delets a namespace - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: The namespace was successfully deleted. - schema: - $ref: '#/definitions/models.Message' - "400": - description: Invalid namespace object provided. - schema: - $ref: '#/definitions/web.HTTPError' - "403": - description: The user does not have access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Deletes a namespace - tags: - - namespace - get: - consumes: - - application/json - description: Returns a namespace by its ID. - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: The Namespace - schema: - $ref: '#/definitions/models.Namespace' - "403": - description: The user does not have access to that namespace. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Gets one namespace - tags: - - namespace - /namespaces/{id}/projects: - get: - consumes: - - application/json - description: Returns all projects inside of a namespace. - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: The projects. - schema: - items: - $ref: '#/definitions/models.Project' - type: array - "403": - description: No access to that namespace. - schema: - $ref: '#/definitions/models.Message' - "404": - description: The namespace does not exist. - schema: - $ref: '#/definitions/models.Message' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Get all projects in a namespace - tags: - - namespace - /namespaces/{id}/teams: - get: - consumes: - - application/json - description: Returns a namespace with all teams which have access on a given - namespace. - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - - description: The page number. Used for pagination. If not provided, the first - page of results is returned. - in: query - name: page - type: integer - - description: The maximum number of items per page. Note this parameter is - limited by the configured maximum of items per page. - in: query - name: per_page - type: integer - - description: Search teams by its name. - in: query - name: s - type: string - produces: - - application/json - responses: - "200": - description: The teams with the right they have. - schema: - items: - $ref: '#/definitions/models.TeamWithRight' - type: array - "403": - description: No right to see the namespace. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Get teams on a namespace - tags: - - sharing - put: - consumes: - - application/json - description: Gives a team access to a namespace. - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - - description: The team you want to add to the namespace. - in: body - name: namespace - required: true - schema: - $ref: '#/definitions/models.TeamNamespace' - produces: - - application/json - responses: - "201": - description: The created team<->namespace relation. - schema: - $ref: '#/definitions/models.TeamNamespace' - "400": - description: Invalid team namespace object provided. - schema: - $ref: '#/definitions/web.HTTPError' - "403": - description: The team does not have access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "404": - description: The team does not exist. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Add a team to a namespace - tags: - - sharing - /namespaces/{id}/users: - get: - consumes: - - application/json - description: Returns a namespace with all users which have access on a given - namespace. - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - - description: The page number. Used for pagination. If not provided, the first - page of results is returned. - in: query - name: page - type: integer - - description: The maximum number of items per page. Note this parameter is - limited by the configured maximum of items per page. - in: query - name: per_page - type: integer - - description: Search users by its name. - in: query - name: s - type: string - produces: - - application/json - responses: - "200": - description: The users with the right they have. - schema: - items: - $ref: '#/definitions/models.UserWithRight' - type: array - "403": - description: No right to see the namespace. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Get users on a namespace - tags: - - sharing - put: - consumes: - - application/json - description: Gives a user access to a namespace. - parameters: - - description: Namespace ID - in: path - name: id - required: true - type: integer - - description: The user you want to add to the namespace. - in: body - name: namespace - required: true - schema: - $ref: '#/definitions/models.NamespaceUser' - produces: - - application/json - responses: - "201": - description: The created user<->namespace relation. - schema: - $ref: '#/definitions/models.NamespaceUser' - "400": - description: Invalid user namespace object provided. - schema: - $ref: '#/definitions/web.HTTPError' - "403": - description: The user does not have access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "404": - description: The user does not exist. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Add a user to a namespace - tags: - - sharing - /namespaces/{namespaceID}/projects: - put: - consumes: - - application/json - description: Creates a new project in a given namespace. The user needs write-access - to the namespace. - parameters: - - description: Namespace ID - in: path - name: namespaceID - required: true - type: integer - - description: The project you want to create. - in: body - name: project - required: true - schema: - $ref: '#/definitions/models.Project' - produces: - - application/json - responses: - "201": - description: The created project. - schema: - $ref: '#/definitions/models.Project' - "400": - description: Invalid project object provided. - schema: - $ref: '#/definitions/web.HTTPError' - "403": - description: The user does not have access to the project - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Creates a new project - tags: - - project - /namespaces/{namespaceID}/teams/{teamID}: - delete: - description: Delets a team from a namespace. The team won't have access to the - namespace anymore. - parameters: - - description: Namespace ID - in: path - name: namespaceID - required: true - type: integer - - description: team ID - in: path - name: teamID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: The team was successfully deleted. - schema: - $ref: '#/definitions/models.Message' - "403": - description: The team does not have access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "404": - description: team or namespace does not exist. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Delete a team from a namespace - tags: - - sharing - post: - consumes: - - application/json - description: Update a team <-> namespace relation. Mostly used to update the - right that team has. - parameters: - - description: Namespace ID - in: path - name: namespaceID - required: true - type: integer - - description: Team ID - in: path - name: teamID - required: true - type: integer - - description: The team you want to update. - in: body - name: namespace - required: true - schema: - $ref: '#/definitions/models.TeamNamespace' - produces: - - application/json - responses: - "200": - description: The updated team <-> namespace relation. - schema: - $ref: '#/definitions/models.TeamNamespace' - "403": - description: The team does not have admin-access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "404": - description: Team or namespace does not exist. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Update a team <-> namespace relation - tags: - - sharing - /namespaces/{namespaceID}/users/{userID}: - delete: - description: Delets a user from a namespace. The user won't have access to the - namespace anymore. - parameters: - - description: Namespace ID - in: path - name: namespaceID - required: true - type: integer - - description: user ID - in: path - name: userID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: The user was successfully deleted. - schema: - $ref: '#/definitions/models.Message' - "403": - description: The user does not have access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "404": - description: user or namespace does not exist. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Delete a user from a namespace - tags: - - sharing - post: - consumes: - - application/json - description: Update a user <-> namespace relation. Mostly used to update the - right that user has. - parameters: - - description: Namespace ID - in: path - name: namespaceID - required: true - type: integer - - description: User ID - in: path - name: userID - required: true - type: integer - - description: The user you want to update. - in: body - name: namespace - required: true - schema: - $ref: '#/definitions/models.NamespaceUser' - produces: - - application/json - responses: - "200": - description: The updated user <-> namespace relation. - schema: - $ref: '#/definitions/models.NamespaceUser' - "403": - description: The user does not have admin-access to the namespace - schema: - $ref: '#/definitions/web.HTTPError' - "404": - description: User or namespace does not exist. - schema: - $ref: '#/definitions/web.HTTPError' - "500": - description: Internal error - schema: - $ref: '#/definitions/models.Message' - security: - - JWTKeyAuth: [] - summary: Update a user <-> namespace relation - tags: - - sharing /notifications: get: consumes: @@ -2988,6 +2244,42 @@ paths: summary: Get all projects a user has access to tags: - project + put: + consumes: + - application/json + description: Creates a new project. If a parent project is provided the user + needs to have write access to that project. + parameters: + - description: The project you want to create. + in: body + name: project + required: true + schema: + $ref: '#/definitions/models.Project' + produces: + - application/json + responses: + "201": + description: The created project. + schema: + $ref: '#/definitions/models.Project' + "400": + description: Invalid project object provided. + schema: + $ref: '#/definitions/web.HTTPError' + "403": + description: The user does not have access to the project + schema: + $ref: '#/definitions/web.HTTPError' + "500": + description: Internal error + schema: + $ref: '#/definitions/models.Message' + security: + - JWTKeyAuth: [] + summary: Creates a new project + tags: + - project /projects/{id}: delete: description: Delets a project @@ -3876,15 +3168,15 @@ paths: - application/json description: Copies the project, tasks, files, kanban data, assignees, comments, attachments, lables, relations, backgrounds, user/team rights and link shares - from one project to a new namespace. The user needs read access in the project - and write access in the namespace of the new project. + from one project to a new one. The user needs read access in the project and + write access in the parent of the new project. parameters: - description: The project ID to duplicate in: path name: projectID required: true type: integer - - description: The target namespace which should hold the copied project. + - description: The target parent project which should hold the copied project. in: body name: project required: true @@ -3902,7 +3194,7 @@ paths: schema: $ref: '#/definitions/web.HTTPError' "403": - description: The user does not have access to the project or namespace + description: The user does not have access to the project or its parent. schema: $ref: '#/definitions/web.HTTPError' "500": @@ -4244,8 +3536,8 @@ paths: - application/json description: Unsubscribes the current user to an entity. parameters: - - description: The entity the user subscribed to. Can be either `namespace`, - `project` or `task`. + - description: The entity the user subscribed to. Can be either `project` or + `task`. in: path name: entity required: true @@ -4284,8 +3576,8 @@ paths: - application/json description: Subscribes the current user to an entity. parameters: - - description: The entity the user subscribes to. Can be either `namespace`, - `project` or `task`. + - description: The entity the user subscribes to. Can be either `project` or + `task`. in: path name: entity required: true @@ -5353,8 +4645,7 @@ paths: put: consumes: - application/json - description: Creates a new team in a given namespace. The user needs write-access - to the namespace. + description: Creates a new team. parameters: - description: The team you want to create. in: body