OpenFolia

Review a module’s style with a model

POST
/change-sets/{changeSetId}/modules/{lang}/{moduleId}/style-review

Asks the configured language model for style and consistency suggestions on one module of a change set: its working copy, else the file committed on its branch. Off by default: without a configured endpoint (CCMS_STYLE_REVIEW_URL) it is 404 not-configured and nothing is sent anywhere. What is sent: only the module’s translatable text (each block’s own text as plain text, by block ID) and the style guide in openfolia.yaml (styleGuide): no metadata, no comments, no other module. Nothing is stored; one module.style-review audit event records who asked, for which module, the outcome and how many suggestions (never the text). The suggestions are advice: each one names a block, a part and a range of its text; one that does not fit the module’s text is dropped (meta.dropped). Only the change set’s author, within their reading scope, as the working copy is read (403 for anyone else who holds content.read.draft; for anyone else another author’s change set is 404, exactly like a missing one). No body. Needs the content.edit permission (and content.read, which reading the module needs).

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Path Parameters

changeSetId*string

The change set’s ID (a UUID). One that names no change set, malformed or not, is 404.

Formatuuid
lang*string

A language with subtags of 2 to 8 characters (en, pt-BR); any case. One that is not is 404.

moduleId*string
Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Lengthlength <= 100

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Request Body

application/vnd.api+json
  1. body

Response Body

application/vnd.api+json
  1. response
data*
Example Request
curl -X POST 'http://localhost:3000/change-sets/497f6eca-6276-4993-bfeb-53cbbbba6f08/modules/en/battery-charging/style-review' \  -H 'Content-Type: application/vnd.api+json' \  -d '{}'
Example Response
{  "data": {    "type": "StyleReview",    "id": "string",    "attributes": {      "lang": "string",      "moduleId": "string",      "suggestions": [        {          "id": "string",          "blockId": "string",          "field": "title",          "range": {            "start": 0,            "end": 1          },          "original": "string",          "message": "string",          "replacement": "string",          "rule": "model"        }      ]    },    "meta": {      "version": 0,      "baseCommit": "string",      "dropped": 0    }  }}