Wanikani Open Framework [developer thread]

@seanblue,
Per the [Api V2] thread, I’ve updated the Open Framework to support /srs_stages, plus opened up default support for any future endpoints so I won’t have to explicitly add them (unless they don’t conform to the current format for some reason).

The recommended way to fetch /srs_stages is via:

wkof.Apiv2.get_endpoint('srs_stages')
.then(do_something);

Note that, even though it caches the endpoint, it will still ask WK if the endpoint has been updated. So, if you want to limit how often it checks for an update, you can look at the date it was added to cache:

if (wkof.file_cache.dir['Apiv2.srs_stages']) {
    var fetch_date = new Date(wkof.file_cache.dir['Apiv2.srs_stages'].added);
    var days_since_fetch = Date.now() - fetch_date;
}