Finds entities (people, places, organizations, titles) in cinii. Meant to be used with cwrc-public-entity-dialogs where it runs in the browser.
Although it will not work in node.js as-is, it does use the Fetch API for http requests, and so could likely therefore use a browser/node.js compatible fetch implementation like: isomorphic-fetch.
npm i cinii-entity-lookup
import ciniiLookup from 'cinii-entity-lookup';
where the 'query' argument is an object:
{
entity: "The name of the thing the user wants to find.",
options: "TBD"
}
and all find* methods return promises that resolve to an object like the following:
{
"id": "https://cinii.org/cinii/9447148209321300460003/",
"name": "Fay Jones School of Architecture and Design",
"nameType": "Corporate",
"originalQueryString": "jones",
"repository": "cinii",
"uri": "https://cinii.org/9447148209321300460003/",
"uriForDisplay": "https://cinii.org/9447148209321300460003/"
}
There are a further four methods that are mainly made available to facilitate testing (to make it easier to mock calls to the cinii service):
where the 'query' argument is the entity name to find and the methods return the cinii URL that in turn returns results for the query.
CWRC-Writer-Dev-Docs describes general development practices for CWRC-Writer GitHub repositories, including this one.
We use fetch-mock to mock http calls (which we make using the Fetch API rather than XMLHttpRequest).
We use Travis.
We follow SemVer, which Semantic Release makes easy. Semantic Release also writes our commit messages, sets the version number, publishes to NPM, and finally generates a changelog and a release (including a git tag) on GitHub.