Key
The request-to-fixture key scheme shared by the demo
transport and scripts/generate_demo_data.py. Both sides MUST produce
byte-identical keys, so keep this in lockstep with the Python key_of mirror.
GET/DELETE keys are METHOD /api/<path>?<sorted-query>. The handful of
body-keyed POSTs (tokenize batch + the LLM flows) also append a canonical,
sorted-key JSON of a per-endpoint field subset.
Functions¶
keyOf()¶
Defined in: src/demo/api/key.ts:58
Computes the fixture key for a request in the /api-prefixed frontend form.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
method |
string |
The HTTP method. |
url |
string |
The relative API path (as passed to apiFetch/streamSSE). |
body? |
unknown |
The request body (a JSON string from apiFetch, or a raw object from streamSSE); only used for the body-keyed POSTs. |
Returns¶
string
The lookup key.