Update API.md
This commit is contained in:
parent
10bdac0109
commit
9fc0436bf2
47
API.md
47
API.md
|
@ -176,33 +176,46 @@ req.clientApiUri // The api URL for the instance of an app
|
||||||
|
|
||||||
req.pkgId // The name of the package being accessed
|
req.pkgId // The name of the package being accessed
|
||||||
// i.e. the 'hello@example.com' part of https://api.example.com/api/hello@example.com/kv/foo
|
// i.e. the 'hello@example.com' part of https://api.example.com/api/hello@example.com/kv/foo
|
||||||
|
|
||||||
|
req.oauth3.accountIdx // The system id of the account represented by the token
|
||||||
|
// i.e. this is the user
|
||||||
```
|
```
|
||||||
|
|
||||||
Internal (and/or deprecated) APIs that you will very likely encounter
|
Internal (and/or deprecated) APIs that you will very likely encounter
|
||||||
|
|
||||||
```
|
```
|
||||||
|
req.getSiteStore().then(function (models) {
|
||||||
|
req.Models = models;
|
||||||
|
});
|
||||||
|
|
||||||
req.getSiteStore().then(function (models) {
|
//
|
||||||
req.Models = models;
|
// Consider Models for a package 'hello@example.com', the would be named like so
|
||||||
});
|
//
|
||||||
|
req.Models.HelloExampleComData.create(obj)
|
||||||
|
req.Models.ComExampleHelloData.save(obj)
|
||||||
|
req.Models.ComExampleHelloData.find(params)
|
||||||
|
req.Models.ComExampleHelloData.destroy(objOrId)
|
||||||
|
|
||||||
req.Models.ComExampleHelloData.create(obj)
|
//
|
||||||
req.Models.ComExampleHelloData.save(obj)
|
// These should be scoped in such a way that the only hand back data specific
|
||||||
req.Models.ComExampleHelloData.find(params)
|
// to the experience and not expose secrets
|
||||||
req.Models.ComExampleHelloData.destroy(objOrId)
|
//
|
||||||
|
|
||||||
req.oauth3.accountIdx // The system id of the account represented by the token
|
req.getSiteConfig('com.example.hello').then(function (config) {
|
||||||
|
// the com.example.hello section of /srv/walnut/etc/:domain/config.json
|
||||||
|
});
|
||||||
|
req.getSitePackageConfig
|
||||||
|
|
||||||
req.getSiteConfig('com.example.hello').then(function (config) {
|
//
|
||||||
// the com.example.hello section of /srv/walnut/etc/:domain/config.json
|
// Deprecated
|
||||||
});
|
//
|
||||||
req.getSitePackageConfig
|
// These helper methods should be moved to a capability
|
||||||
req.getSiteMailer().then(function (mailer) {});
|
|
||||||
|
|
||||||
// helper methods until we have agnostic means of doing the same / similar tasks
|
req.Stripe
|
||||||
req.Stripe
|
req.Mandrill
|
||||||
req.Mandrill
|
req.Mailchimp
|
||||||
req.Mailchimp
|
|
||||||
|
req.getSiteMailer().then(function (mailer) {});
|
||||||
```
|
```
|
||||||
|
|
||||||
RESTful API Contstraints
|
RESTful API Contstraints
|
||||||
|
|
Loading…
Reference in New Issue