moot-interface

0.0.0 • Public • Published

moot-interface

The browser-based interface for the moot demo.

Uses: rollup, svelte, asr, mannish, etc.

run scripts

  • build: runs all build scripts
  • develop: run watchers to rebuild on changes, run demo server

required mediator

The moot interface requires a data provider under the mediated name moot-api.

This data provider is essentially a JSON API interface, but the moot-interface does not keep the HTTP-request opinion: you are free to create a data provider of any sort, so long as the mediated provider has a JSON API interface.

You'll need to make a provider named moot-api:

mediator.provide('moot-api', request)

Where request is an object with the following properties:

  • method (string, always present): Will be a valid, upper-cased HTTP request name, e.g. GET and PUT.
  • url (string, always present): A valid URL of the form /${version}/${path} where version is the API version number, e.g. v1, and path is the resource indicator path, e.g. secure/games/abc123.
  • filter (object, optional): A key-value object which limits the requested resources, e.g. { sport: 'football' }.
  • include (object, optional): Whether to include related objects, for example { team: true } would include a team object in the response, if one was defined for the queried resource, while { team: false } would explicitly keep it from the returned data.
  • fields (object, optional): Limit the data in the response. The key is the name of the resource to limit, and the value is an array of strings which property names, e.g. { team: [ 'name' ] } will only include the name properties in the team object.

The complete list of requests which need to be supported is available here.

Readme

Keywords

Package Sidebar

Install

npm i moot-interface

Weekly Downloads

0

Version

0.0.0

License

VOL

Last publish

Collaborators

  • saibotsivad