Operazioni sulla configurazione delle API
2 operazioni di nome apiConfig.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| apiConfig.read | Read the site's API configuration: the external API sources (each a base URL the public site's proxy may call), the shared headers, the baseUrl and the named requests the site's data calls use. | site.read | none |
| apiConfig.update | Replace the site's API configuration as a whole: baseUrl, headers, sources (the public proxy forwards only to a URL under a source's base URL) and requests ({ id, name, method, endpoint, sourceId?, body?, contract? }). | site.admin | none |
apiConfig.read
Read the site's API configuration: the external API sources (each a base URL the public site's proxy may call), the shared headers, the baseUrl and the named requests the site's data calls use.
Esempio di input
{}Input
L’input è un record: vedi lo schema qui sotto.
{
"type": "object",
"properties": {},
"additionalProperties": false
}Output
| Field | Type | Required | Notes |
|---|---|---|---|
| config | object | null | yes |
Provala
yarn splash apiConfig.read '{}' --dry-runapiConfig.update
Replace the site's API configuration as a whole: baseUrl, headers, sources (the public proxy forwards only to a URL under a source's base URL) and requests ({ id, name, method, endpoint, sourceId?, body?, contract? }). Undo restores the previous configuration.
Esempio di input
{
"headers": [],
"sources": [],
"requests": [
{
"id": "feed",
"name": "Feed",
"method": "GET",
"endpoint": "/feed"
}
]
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| baseUrl | string | no | |
| headers | array of object | yes | |
| headers[].key | string | yes | |
| headers[].value | string | yes | |
| headers[].type | string | no | |
| headers[].source | string | null | no | |
| sources | array of object | no | Default []. |
| sources[].id | string | yes | |
| sources[].name | string | yes | |
| sources[].baseUrl | string | yes | |
| sources[].color | string | null | no | |
| requests | array of object | yes | |
| requests[].id | string | yes | |
| requests[].name | string | yes | |
| requests[].method | string | yes | |
| requests[].endpoint | string | yes | |
| requests[].sourceId | string | null | no | |
| requests[].body | record of any JSON | no | |
| requests[].contract | record of string | no |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| config | object | null | yes |
Provala
yarn splash apiConfig.update '{"headers":[],"sources":[],"requests":[{"id":"feed","name":"Feed","method":"GET","endpoint":"/feed"}]}' --dry-runGenerato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 9efb1801fba294e2).
Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.