190 lines
7.8 KiB
Plaintext
190 lines
7.8 KiB
Plaintext
<ToolPageFrame
|
|
Eyebrow="API reference"
|
|
Title="API Surface"
|
|
Summary="The stable lookup and critical-cell editing contracts are grouped here by workflow so diagnostics and curation work can move quickly without leaving the app shell.">
|
|
<Actions>
|
|
<a class="btn btn-link" href="/tools">All tools</a>
|
|
<a class="btn btn-secondary" href="/tools/diagnostics">Open diagnostics</a>
|
|
</Actions>
|
|
|
|
<ChildContent>
|
|
<div class="api-reference-groups">
|
|
<section class="api-reference-group">
|
|
<div class="api-reference-group-header">
|
|
<span class="tool-page-eyebrow">Read models</span>
|
|
<h2>Reference and lookup payloads</h2>
|
|
</div>
|
|
|
|
<div class="api-grid">
|
|
<section class="panel tooling-surface api-endpoint-card">
|
|
<div class="api-endpoint-card-header">
|
|
<h3 class="panel-title">Reference data</h3>
|
|
<code>GET /api/reference-data</code>
|
|
</div>
|
|
<div class="tool-link-card-summary">Bootstraps attack tables, critical tables, labels, and high-level metadata for the main client flows.</div>
|
|
<pre class="code-block">{
|
|
"attackTables": [
|
|
{
|
|
"key": "broadsword",
|
|
"label": "Broadsword",
|
|
"attackKind": "melee",
|
|
"fumbleMinRoll": 1,
|
|
"fumbleMaxRoll": 2
|
|
}
|
|
],
|
|
"criticalTables": [
|
|
{
|
|
"key": "mana",
|
|
"label": "Mana Critical Strike Table",
|
|
"family": "standard",
|
|
"sourceDocument": "Mana.pdf",
|
|
"notes": "Imported from PDF XML extraction."
|
|
}
|
|
]
|
|
}</pre>
|
|
</section>
|
|
|
|
<section class="panel tooling-surface api-endpoint-card">
|
|
<div class="api-endpoint-card-header">
|
|
<h3 class="panel-title">Attack lookup</h3>
|
|
<code>POST /api/lookup/attack</code>
|
|
</div>
|
|
<div class="tool-link-card-summary">Resolves attack-table outcomes for the player-facing `Play` surface.</div>
|
|
<pre class="code-block">{
|
|
"attackTable": "broadsword",
|
|
"armorType": "AT10",
|
|
"roll": 111,
|
|
"criticalRoll": 72
|
|
}</pre>
|
|
</section>
|
|
|
|
<section class="panel tooling-surface api-endpoint-card">
|
|
<div class="api-endpoint-card-header">
|
|
<h3 class="panel-title">Critical lookup</h3>
|
|
<code>POST /api/lookup/critical</code>
|
|
</div>
|
|
<div class="tool-link-card-summary">Returns resolved critical outcomes plus the imported table metadata needed to inspect the underlying source row.</div>
|
|
<pre class="code-block">{
|
|
"criticalType": "mana",
|
|
"column": "E",
|
|
"roll": 100,
|
|
"group": null
|
|
}</pre>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="api-reference-group">
|
|
<div class="api-reference-group-header">
|
|
<span class="tool-page-eyebrow">Curation contracts</span>
|
|
<h2>Critical-cell editing workflow</h2>
|
|
</div>
|
|
|
|
<div class="api-grid">
|
|
<section class="panel tooling-surface api-endpoint-card">
|
|
<div class="api-endpoint-card-header">
|
|
<h3 class="panel-title">Cell editor load</h3>
|
|
<code>GET /api/tables/critical/{slug}/cells/{resultId}</code>
|
|
</div>
|
|
<div class="tool-link-card-summary">Loads the full editable graph for one stored critical-table cell, including review notes and nested branches.</div>
|
|
<pre class="code-block">{
|
|
"resultId": 412,
|
|
"tableSlug": "slash",
|
|
"tableName": "Slash Critical Strike Table",
|
|
"rollBand": "66-70",
|
|
"groupKey": null,
|
|
"columnKey": "C",
|
|
"isCurated": false,
|
|
"sourcePageNumber": 1,
|
|
"sourceImageUrl": "/api/tables/critical/slash/cells/412/source-image",
|
|
"rawCellText": "Original imported full cell text",
|
|
"descriptionText": "Current curated prose",
|
|
"rawAffixText": "+8H - 2S",
|
|
"parseStatus": "verified",
|
|
"parsedJson": "{\"version\":1,\"isDescriptionOverridden\":false,\"isRawAffixTextOverridden\":false,\"areEffectsOverridden\":false,\"areBranchesOverridden\":false,\"effects\":[],\"branches\":[]}",
|
|
"isDescriptionOverridden": false,
|
|
"isRawAffixTextOverridden": false,
|
|
"areEffectsOverridden": false,
|
|
"areBranchesOverridden": false,
|
|
"validationMessages": [],
|
|
"effects": [],
|
|
"branches": []
|
|
}</pre>
|
|
</section>
|
|
|
|
<section class="panel tooling-surface api-endpoint-card">
|
|
<div class="api-endpoint-card-header">
|
|
<h3 class="panel-title">Cell source image</h3>
|
|
<code>GET /api/tables/critical/{slug}/cells/{resultId}/source-image</code>
|
|
</div>
|
|
<div class="tool-link-card-summary">Streams the importer-generated PNG crop for the current critical cell and returns `404` when no stored artifact is available.</div>
|
|
</section>
|
|
|
|
<section class="panel tooling-surface api-endpoint-card">
|
|
<div class="api-endpoint-card-header">
|
|
<h3 class="panel-title">Cell re-parse</h3>
|
|
<code>POST /api/tables/critical/{slug}/cells/{resultId}/reparse</code>
|
|
</div>
|
|
<div class="tool-link-card-summary">Re-runs the single-cell parser and merges generated output with the current override state without persisting changes.</div>
|
|
<pre class="code-block">{
|
|
"currentState": {
|
|
"rawCellText": "Strike to thigh. +8H\nWith greaves: blow glances aside.",
|
|
"descriptionText": "Curated prose",
|
|
"rawAffixText": "+8H",
|
|
"parseStatus": "partial",
|
|
"parsedJson": "{}",
|
|
"isCurated": false,
|
|
"isDescriptionOverridden": true,
|
|
"isRawAffixTextOverridden": false,
|
|
"areEffectsOverridden": false,
|
|
"areBranchesOverridden": false,
|
|
"effects": [],
|
|
"branches": []
|
|
}
|
|
}</pre>
|
|
</section>
|
|
|
|
<section class="panel tooling-surface api-endpoint-card">
|
|
<div class="api-endpoint-card-header">
|
|
<h3 class="panel-title">Cell editor save</h3>
|
|
<code>PUT /api/tables/critical/{slug}/cells/{resultId}</code>
|
|
</div>
|
|
<div class="tool-link-card-summary">Replaces the stored base result, branch rows, and effect rows for the targeted cell with the submitted curated payload.</div>
|
|
<pre class="code-block">{
|
|
"rawCellText": "Corrected imported text",
|
|
"descriptionText": "Rewritten prose after manual review",
|
|
"rawAffixText": "+10H - must parry 2 rnds",
|
|
"parseStatus": "manually_curated",
|
|
"parsedJson": "{\"reviewed\":true}",
|
|
"isCurated": true,
|
|
"isDescriptionOverridden": true,
|
|
"isRawAffixTextOverridden": false,
|
|
"areEffectsOverridden": false,
|
|
"areBranchesOverridden": false,
|
|
"effects": [
|
|
{
|
|
"effectCode": "direct_hits",
|
|
"target": null,
|
|
"valueInteger": 10,
|
|
"valueDecimal": null,
|
|
"valueExpression": null,
|
|
"durationRounds": null,
|
|
"perRound": null,
|
|
"modifier": null,
|
|
"bodyPart": null,
|
|
"isPermanent": false,
|
|
"sourceType": "symbol",
|
|
"sourceText": "+10H",
|
|
"originKey": "base:direct_hits:1",
|
|
"isOverridden": true
|
|
}
|
|
],
|
|
"branches": []
|
|
}</pre>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</ChildContent>
|
|
</ToolPageFrame>
|