OpenFolia

Compare two versions of a module

GET
/modules/{lang}/{id}/compare

The module at both versions and how it changed, block by block, in the shape of a change set’s changes (meta.change, meta.fields, meta.blocks), so the review screen’s diff renders it. Each side is read as reading its commit needs: a released commit (main’s head, a release tag) with content.read, any other, also an older commit of main, with content.read.draft, else 404 as for a ref that does not exist. Each side shows the module only as the reader would see it on the other too; a side where it is not there is added or removed; 404 when neither has it.

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

lang*string
Length1 <= length <= 64
id*string
Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Lengthlength <= 100

Query Parameters

base*string

The older version: a commit ID or a tag.

Length1 <= length <= 256
head*string

The newer version: a commit ID or a tag.

Length1 <= length <= 256

Response Body

application/vnd.api+json
  1. response
data*

id is <lang>/<moduleId>/<base commit>..<head commit>. Derived from Git, never stored.

Example Request
curl -X GET 'http://localhost:3000/modules/en/battery-charging/compare?base=string&head=string'
Example Response
{  "data": {    "type": "ModuleComparison",    "id": "string",    "attributes": {      "base": {        "moduleId": "string",        "lang": "string",        "schemaVersion": 1,        "title": "string",        "moduleType": "string",        "audience": "string",        "facets": {},        "keywords": [          "string"        ],        "source": {          "system": "string",          "id": "string"        },        "deprecated": {          "reason": "string",          "replacedBy": "string"        },        "blocks": [          {            "type": "paragraph",            "id": "string",            "content": [              {                "type": "text",                "text": "string",                "marks": [                  {                    "type": "strong"                  }                ]              }            ]          }        ]      },      "head": {        "moduleId": "string",        "lang": "string",        "schemaVersion": 1,        "title": "string",        "moduleType": "string",        "audience": "string",        "facets": {},        "keywords": [          "string"        ],        "source": {          "system": "string",          "id": "string"        },        "deprecated": {          "reason": "string",          "replacedBy": "string"        },        "blocks": [          {            "type": "paragraph",            "id": "string",            "content": [              {                "type": "text",                "text": "string",                "marks": [                  {                    "type": "strong"                  }                ]              }            ]          }        ]      }    },    "meta": {      "base": "string",      "head": "string",      "change": "added",      "fields": [        "string"      ],      "blocks": [        {          "blockId": "string",          "change": "added"        }      ],      "unreadable": true    }  }}