OpenFolia

Report module usage

GET
/reports/module-usage

One ModuleUsage per module the reader may see in some language, at ?ref=, from the module index: how many manuals include it (directly or through module references) and how many modules refer to it, with meta.usedIn. Only manuals and modules the reader may see are named or counted, and a manual counts through module references only where the reader may see every module on the way. A module file that cannot be read is left out. Filtered and sorted before paging, so meta.page.total counts what is listed; GET /reports/module-usage/csv downloads all of it. Needs content.read.draft (in any scope), on top of reading content (content.read); what it names and counts is limited by the reader’s scope, its languages included.

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.

Query Parameters

filter[unused]?string

true: only modules no manual includes, directly or through module references (a module only other modules refer to is unused if none of them is in a manual); false: only modules some manual includes.

Value in"true""false"
filter[type]?string

Only modules of this module type; one the configuration does not know matches nothing.

Match^[a-z][a-z0-9-]*$
Lengthlength <= 64
sort?string

Comma-separated fields (id, title, type, manuals, modules, usage; manuals and modules are the use counts, usage their sum), each --prefixed for descending, each at most once; ties by title, then ID. Default: title.

page[number]?integer

Page to return, from 1. Default: 1.

Range1 <= value
page[size]?integer

Resources per page. Default: 50, at most 200.

Range1 <= value <= 200
ref?string

Branch, tag or commit ID to read from. Default: the server's CCMS_DEFAULT_REF.

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).

Response Body

application/vnd.api+json
  1. response
data*array<>
meta*
links*
Example Request
curl -X GET 'http://localhost:3000/reports/module-usage'
Example Response
{  "data": [    {      "type": "ModuleUsage",      "id": "string",      "attributes": {        "moduleId": "string",        "title": "string",        "type": "string",        "deprecated": true      },      "meta": {        "languages": [          "string"        ],        "usage": {          "manuals": 0,          "modules": 0        },        "usedIn": [          {            "kind": "manual",            "id": "string",            "title": "string",            "direct": true,            "deprecated": true          }        ]      }    }  ],  "meta": {    "page": {      "currentPage": -9007199254740991,      "lastPage": -9007199254740991,      "perPage": -9007199254740991,      "total": -9007199254740991    }  },  "links": {    "self": "string",    "first": "string",    "last": "string",    "prev": "string",    "next": "string"  }}