xtuple/xtuple — pull request #279 by bendiy (2013-04-15 01:44:42+00:00)
Title: Issue #19304 - Add route generator for resource end points

This PR includes #18716 already merged in.

It adds REST URI endpoints for the REST API Discovery Service. They will return Discovery Documents and Lists and are publically accessible. However, they do not expose any sensitive information.

/discovery/v1alpha1/apis/:org/:model/v1alpha1/rest
e.g. https://mobile.xtuple.com/discovery/v1alpha1/apis/toytruck/contact/v1alpha1/rest

/discovery/v1alpha1/apis/:org/v1alpha1/res
e.g. https://mobile.xtuple.com/discovery/v1alpha1/apis/toytruck/v1alpha1/rest

/discovery/v1alpha1/apis/:org
e.g. https://mobile.xtuple.com/discovery/v1alpha1/apis/toytruck

API Discovery Handler:
> https://github.com/bendiy/xtuple/blob/19304/node-datasource/routes/restDiscovery.js

It also adds the restRouter which exposes REST URI enpoints and maps them to resources. Currently, those resources do not do anything. That will come with #19305 and when #20044 is done. You must use an OAuth 2.0 Access Token to access these URIs:

/api/v1alpha1/:model/:id
e.g. https://mobile.xtuple.com/api/v1alpha1/contact/42

/api/v1alpha1/:model
e.g. https://mobile.xtuple.com/api/v1alpha1/contact

REST URI Stub code:
> https://github.com/bendiy/xtuple/blob/19304/node-datasource/routes/restRouter.js#L60-L92