diff --git a/doc/compiled.json b/doc/compiled.json index 963c97834..04fc92caf 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -160,6 +160,10 @@ { "name": "Pre Translations" }, + { + "name": "Project Notes", + "description": "Manage Markdown-formatted notes attached to projects." + }, { "name": "Projects" }, @@ -234,6 +238,7 @@ "name": "Core Resources", "tags": [ "Projects", + "Project Notes", "Locales", "Keys", "Key Format Annotations", @@ -2310,6 +2315,29 @@ "fr": "French" } }, + "note": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique code identifying the note.", + "example": "abcd1234efgh5678" + }, + "body": { + "type": "string", + "description": "Markdown-formatted content of the note (max 65,535 characters).", + "example": "## Project context\n\nThis project contains all marketing strings." + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, "project": { "type": "object", "title": "project", @@ -2500,6 +2528,9 @@ }, "branch": { "$ref": "#/components/schemas/branch" + }, + "note": { + "$ref": "#/components/schemas/note" } }, "example": { @@ -18982,6 +19013,185 @@ "x-cli-version": "2.5" } }, + "/projects/{project_id}/note": { + "get": { + "summary": "Get a project note", + "description": "Returns the Markdown-formatted note attached to a project. The note is\nresolved against the main project — branch projects return the main\nproject's note. Returns 404 when no note has been created yet. Requires\nthe `read` OAuth scope.\n", + "operationId": "project_note/show", + "tags": [ + "Project Notes" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/branch" + } + ], + "responses": { + "200": { + "description": "OK", + "headers": { + "X-Rate-Limit-Limit": { + "$ref": "#/components/headers/X-Rate-Limit-Limit" + }, + "X-Rate-Limit-Remaining": { + "$ref": "#/components/headers/X-Rate-Limit-Remaining" + }, + "X-Rate-Limit-Reset": { + "$ref": "#/components/headers/X-Rate-Limit-Reset" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/note" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + } + }, + "patch": { + "summary": "Create or update a project note", + "description": "Creates or updates the Markdown-formatted note for a project. If a note\nalready exists it is updated in place; otherwise a new note is created.\nThe note is stored on the main project — branch projects write to the\nmain project's note. `body` is required. Requires manage permissions on\nthe project and the `write` OAuth scope.\n", + "operationId": "project_note/update", + "tags": [ + "Project Notes" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/branch" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "project_note/update/parameters", + "required": [ + "body" + ], + "properties": { + "body": { + "type": "string", + "description": "Markdown content for the project note (max 65,535 characters).", + "example": "## Project context\n\nThis project contains all marketing strings." + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "headers": { + "X-Rate-Limit-Limit": { + "$ref": "#/components/headers/X-Rate-Limit-Limit" + }, + "X-Rate-Limit-Remaining": { + "$ref": "#/components/headers/X-Rate-Limit-Remaining" + }, + "X-Rate-Limit-Reset": { + "$ref": "#/components/headers/X-Rate-Limit-Reset" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/note" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "429": { + "$ref": "#/components/responses/429" + } + } + }, + "delete": { + "summary": "Delete a project note", + "description": "Deletes the note associated with a project. This operation is idempotent\n— it succeeds silently even when no note exists. The note is resolved\nagainst the main project — branch projects delete the main project's\nnote. Requires manage permissions on the project and the `write` OAuth\nscope.\n", + "operationId": "project_note/destroy", + "tags": [ + "Project Notes" + ], + "parameters": [ + { + "$ref": "#/components/parameters/X-PhraseApp-OTP" + }, + { + "$ref": "#/components/parameters/project_id" + }, + { + "$ref": "#/components/parameters/branch" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/204" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "429": { + "$ref": "#/components/responses/429" + } + } + } + }, "/projects/{project_id}/jobs/{job_id}/locales": { "get": { "summary": "List job target locales", diff --git a/main.yaml b/main.yaml index 7cf82728c..86e35ea44 100644 --- a/main.yaml +++ b/main.yaml @@ -232,6 +232,8 @@ tags: - name: Organization Job Template Locales - name: Organization Job Templates - name: Pre Translations + - name: Project Notes + description: Manage Markdown-formatted notes attached to projects. - name: Projects - name: Quality - name: Releases @@ -309,6 +311,7 @@ x-tagGroups: - name: Core Resources tags: - Projects + - Project Notes - Locales - Keys - Key Format Annotations diff --git a/paths.yaml b/paths.yaml index 26c48c393..e01a0e0bf 100644 --- a/paths.yaml +++ b/paths.yaml @@ -331,6 +331,13 @@ "$ref": "./paths/projects/update.yaml" delete: "$ref": "./paths/projects/destroy.yaml" +"/projects/{project_id}/note": + get: + "$ref": "./paths/project_note/show.yaml" + patch: + "$ref": "./paths/project_note/update.yaml" + delete: + "$ref": "./paths/project_note/destroy.yaml" "/projects/{project_id}/jobs/{job_id}/locales": get: "$ref": "./paths/job_locales/index.yaml" diff --git a/paths/project_note/destroy.yaml b/paths/project_note/destroy.yaml new file mode 100644 index 000000000..384950ef0 --- /dev/null +++ b/paths/project_note/destroy.yaml @@ -0,0 +1,28 @@ +--- +summary: Delete a project note +description: | + Deletes the note associated with a project. This operation is idempotent + — it succeeds silently even when no note exists. The note is resolved + against the main project — branch projects delete the main project's + note. Requires manage permissions on the project and the `write` OAuth + scope. +operationId: project_note/destroy +tags: + - Project Notes +parameters: + - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" + - "$ref": "../../parameters.yaml#/project_id" + - "$ref": "../../parameters.yaml#/branch" +responses: + '204': + "$ref": "../../responses.yaml#/204" + '400': + "$ref": "../../responses.yaml#/400" + '401': + "$ref": "../../responses.yaml#/401" + '403': + "$ref": "../../responses.yaml#/403" + '404': + "$ref": "../../responses.yaml#/404" + '429': + "$ref": "../../responses.yaml#/429" diff --git a/paths/project_note/show.yaml b/paths/project_note/show.yaml new file mode 100644 index 000000000..10e2dd524 --- /dev/null +++ b/paths/project_note/show.yaml @@ -0,0 +1,38 @@ +--- +summary: Get a project note +description: | + Returns the Markdown-formatted note attached to a project. The note is + resolved against the main project — branch projects return the main + project's note. Returns 404 when no note has been created yet. Requires + the `read` OAuth scope. +operationId: project_note/show +tags: + - Project Notes +parameters: + - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" + - "$ref": "../../parameters.yaml#/project_id" + - "$ref": "../../parameters.yaml#/branch" +responses: + '200': + description: OK + headers: + X-Rate-Limit-Limit: + "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" + X-Rate-Limit-Remaining: + "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" + X-Rate-Limit-Reset: + "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" + content: + application/json: + schema: + "$ref": "../../schemas/note.yaml#/note" + '400': + "$ref": "../../responses.yaml#/400" + '401': + "$ref": "../../responses.yaml#/401" + '403': + "$ref": "../../responses.yaml#/403" + '404': + "$ref": "../../responses.yaml#/404" + '429': + "$ref": "../../responses.yaml#/429" diff --git a/paths/project_note/update.yaml b/paths/project_note/update.yaml new file mode 100644 index 000000000..fb67b2094 --- /dev/null +++ b/paths/project_note/update.yaml @@ -0,0 +1,55 @@ +--- +summary: Create or update a project note +description: | + Creates or updates the Markdown-formatted note for a project. If a note + already exists it is updated in place; otherwise a new note is created. + The note is stored on the main project — branch projects write to the + main project's note. `body` is required. Requires manage permissions on + the project and the `write` OAuth scope. +operationId: project_note/update +tags: + - Project Notes +parameters: + - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" + - "$ref": "../../parameters.yaml#/project_id" + - "$ref": "../../parameters.yaml#/branch" +requestBody: + required: true + content: + application/json: + schema: + type: object + title: project_note/update/parameters + required: + - body + properties: + body: + type: string + description: Markdown content for the project note (max 65,535 characters). + example: "## Project context\n\nThis project contains all marketing strings." +responses: + '200': + description: OK + headers: + X-Rate-Limit-Limit: + "$ref": "../../headers.yaml#/X-Rate-Limit-Limit" + X-Rate-Limit-Remaining: + "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" + X-Rate-Limit-Reset: + "$ref": "../../headers.yaml#/X-Rate-Limit-Reset" + content: + application/json: + schema: + "$ref": "../../schemas/note.yaml#/note" + '400': + "$ref": "../../responses.yaml#/400" + '401': + "$ref": "../../responses.yaml#/401" + '403': + "$ref": "../../responses.yaml#/403" + '404': + "$ref": "../../responses.yaml#/404" + '422': + "$ref": "../../responses.yaml#/422" + '429': + "$ref": "../../responses.yaml#/429" diff --git a/schemas.yaml b/schemas.yaml index cc6dac4ba..d1998f1e8 100644 --- a/schemas.yaml +++ b/schemas.yaml @@ -74,6 +74,8 @@ schemas: "$ref": schemas/format.yaml#/format languages: "$ref": schemas/language.yaml#/languages + note: + "$ref": schemas/note.yaml#/note project: "$ref": schemas/project.yaml#/project project_details: diff --git a/schemas/note.yaml b/schemas/note.yaml new file mode 100644 index 000000000..a443ae6c0 --- /dev/null +++ b/schemas/note.yaml @@ -0,0 +1,18 @@ +--- +note: + type: object + properties: + id: + type: string + description: Unique code identifying the note. + example: "abcd1234efgh5678" + body: + type: string + description: Markdown-formatted content of the note (max 65,535 characters). + example: "## Project context\n\nThis project contains all marketing strings." + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time diff --git a/schemas/project_details.yaml b/schemas/project_details.yaml index dcfa8088b..72aa590a9 100644 --- a/schemas/project_details.yaml +++ b/schemas/project_details.yaml @@ -81,6 +81,8 @@ project_details: - "java_properties" branch: "$ref": "./branch.yaml#/branch" + note: + "$ref": "./note.yaml#/note" example: slug: my-android-project