Update API.md
This commit is contained in:
		
							parent
							
								
									10bdac0109
								
							
						
					
					
						commit
						9fc0436bf2
					
				
							
								
								
									
										45
									
								
								API.md
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								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.getSiteStore().then(function (models) {
 | 
					 | 
				
			||||||
  req.Models = models;
 | 
					  req.Models = models;
 | 
				
			||||||
      });
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      req.Models.ComExampleHelloData.create(obj)
 | 
					//
 | 
				
			||||||
      req.Models.ComExampleHelloData.save(obj)
 | 
					// Consider Models for a package 'hello@example.com', the would be named like so
 | 
				
			||||||
      req.Models.ComExampleHelloData.find(params)
 | 
					//
 | 
				
			||||||
      req.Models.ComExampleHelloData.destroy(objOrId)
 | 
					req.Models.HelloExampleComData.create(obj)
 | 
				
			||||||
 | 
					req.Models.ComExampleHelloData.save(obj)
 | 
				
			||||||
 | 
					req.Models.ComExampleHelloData.find(params)
 | 
				
			||||||
 | 
					req.Models.ComExampleHelloData.destroy(objOrId)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      req.oauth3.accountIdx   // The system id of the account represented by the token
 | 
					//
 | 
				
			||||||
 | 
					// These should be scoped in such a way that the only hand back data specific
 | 
				
			||||||
 | 
					// to the experience and not expose secrets
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      req.getSiteConfig('com.example.hello').then(function (config) {
 | 
					req.getSiteConfig('com.example.hello').then(function (config) {
 | 
				
			||||||
    // the com.example.hello section of /srv/walnut/etc/:domain/config.json
 | 
					    // the com.example.hello section of /srv/walnut/etc/:domain/config.json
 | 
				
			||||||
      });
 | 
					});
 | 
				
			||||||
      req.getSitePackageConfig
 | 
					req.getSitePackageConfig
 | 
				
			||||||
      req.getSiteMailer().then(function (mailer) {});
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // helper methods until we have agnostic means of doing the same / similar tasks
 | 
					//
 | 
				
			||||||
      req.Stripe
 | 
					// Deprecated
 | 
				
			||||||
      req.Mandrill
 | 
					//
 | 
				
			||||||
      req.Mailchimp
 | 
					// These helper methods should be moved to a capability
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					req.Stripe
 | 
				
			||||||
 | 
					req.Mandrill
 | 
				
			||||||
 | 
					req.Mailchimp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					req.getSiteMailer().then(function (mailer) {});
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RESTful API Contstraints
 | 
					RESTful API Contstraints
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user