Documentations › mmo.client › js › modules mmo-api-history 1 symbol · generated 30 Nov 2026
The History tab of the API console (mmo-api-console): the last calls of this browser and the calls saved, each opened again in Operations (filled in, not sent). What is kept is what makes the call -- its operation, its values, the data api's query, and for a call saved by hand its body --, never a token nor an answer: an API's answers hold personal data. The last calls are kept in localStorage, apart for each site and each account. The saved calls are the site's when it keeps them (mmo.oauth's user/api-calls.json, MMO.config.user.accounts.apiCalls): « Mine » on any of the account's devices, « Shared » those every account sees -- changed by their owner, deleted by their owner or an administrator; the browser's otherwise. They are exported and imported as a JSON file.
<mmo-api-history></mmo-api-history> Extends CustomShadowElement Asking to open one dispatches `replay` (`detail`: the call). Index LIMIT static readonly accessor the most calls the history keeps storage accessor h(tag, attrs, children) t(text, vars) key(what) read(what) write(what, list) Keep $list under $what (nothing when the browser refuses: a private window) record(entry) Remember a call made, the most recent first, LIMIT at most. accounts() call(url, method, body) async A call of the saved calls' routes, as the page's session -- never the console's identity: they are its account's callUrl(id) save(snapshot, name, shared) async Save a call by hand, its body with it: the site's when it keeps them, shared or not; the browser's otherwise. ask(snapshot, suggested) async Ask a name, and whether to share it when the site keeps the saved calls, then save $snapshot load() async Draw the tab. list(items, what) describe(item) export() Download the saved calls -- mine, the site's or the browser's --, a JSON file: what makes each call only import(file) async Add the calls of a file exported (export): each with a method and a path, the rest as it is -- to mine, the site's (not shared) or the browser's.
Properties2 the most calls the history keeps
static get LIMIT() get storage()
set storage(value) Type StorageMethods16 h(tag, attrs = null, ...children) tag attrs = null ...children returns ElementMMO.core.dom.createElement: a string child is a text node
t(text, vars = {}) text vars = {} returns string$text translated, its {name} replaced by $vars'
key(what) what returns stringthe key of $what in localStorage: this site's, this account's
read(what) what returns Array<Object>what is kept under $what (history, saved), [] when the browser keeps nothing
Keep $list under $what (nothing when the browser refuses: a private window)
write(what, list) Remember a call made, the most recent first, LIMIT at most.
record(entry) entry Objectwhat mmo-api-operation's snapshot() gives, with status, duration, as (who, in words)
accounts() returns Objectmmo.oauth's routes of the accounts (MMO.config.user.accounts): apiCalls, the session's token
A call of the saved calls' routes, as the page's session -- never the console's identity: they are its account's
async call(url, method = 'GET', body = null) url method = 'GET' body = null returns Promise<{ok: boolean, data: *, reason: string>}
callUrl(id) id returns stringthe route of saved call $id (user/api-calls/{id}.json)
Save a call by hand, its body with it: the site's when it keeps them, shared or not; the browser's otherwise.
async save(snapshot, name, shared = false) snapshot Objectname stringshared = false booleanseen by every account returns Promise<void>
Ask a name, and whether to share it when the site keeps the saved calls, then save $snapshot
async ask(snapshot, suggested) snapshot suggested returns Promise<void>
Draw the tab.
async load() list(items, what) items what returns Elementthe calls of $what (history, saved the browser's, mine and shared the site's), each to open again; to save (the history's), to share or not (mine), to remove (the browser's, mine, a shared one for an administrator)
describe(item) item returns stringa call in one line: its path, its values
Download the saved calls -- mine, the site's or the browser's --, a JSON file: what makes each call only
export() Add the calls of a file exported (export): each with a method and a path, the rest as it is -- to mine, the site's (not shared) or the browser's.
async import(file) file ?Filereturns Promise<void>