Merge tag 'v2.4.0'

2.4.0
Project: support custom name in createFromTemplate

Add an optional `name` parameter to Project.createFromTemplate()
to better support yeoman generator workflow, which does not
require the project name to match the directory name.
Project: support custom fs.writeFile

Modify all Project methods working with files to use `Project.writeFile`
instead of `fs.writeFile`. This allows consumers to provide they custom
function for writing files, e.g. yeoman generator's `this.write`.
Define more schema properties

model-definition
  dataSource: String
  public: Boolean

datasource-definition
  defaultForType: String
  connector: String

The properties are defined in such order that Project.loadFromFiles
followed by Project.saveToFiles will preserve the JSON files created
from templates.
datasource: validate uniqueness of name
Project: toConfig() must not use stale relations

Modify Project.toConfig() to always fetch the related models like model
and datasource definitions from the datastore, bypassing any possibly
stale cached values.

Related: strongloop/loopback#256
integration.test: fix failing test

Update the expected push datasource definition to match the real one.
Merge pull request #46 from strongloop/feature/yeoman-support

Modifications required by yeoman generator-loopback
Fix validations of name uniqueness

ModelDefinition.name and DatasourceDefinition.name are validated
for uniqueness within the project only.

Add missing domain object properties:
  ModelDefinition.name
  DatasourceDefinition.name

Add "required" flag to the definition of properties validated
for presence:
  ModelDefinition.dataSource
  DatasourceDefinition.connector

Upgrade loopback-datasource-juggler to "^1.5", as the scoped uniqueness
validator was added in 1.5.0.
Use app.boot() to setup models.

Move the definition of models to `models.json`.

The definition of the default `db` datasource is kept in the main app.js
file for now, as we may want to make it dynamic in the future.
fix typo in jsdoc type annotation
Fix Project.fromConfig to save the object created

Fix `Project.fromConfig` to call `Project.create` instead
of `new Project`. That way:

 - The related entities (model definitions, datasource definitions)
   have correct projectId. Before this change, the related entities
   were not linked to the project.

 - Model validations are executed for the created Project instance.

Rename `Project.fromConfig` to `Project.createFromConfig` to make
the intent of the method more clear.

Fix the bug in `loadConfigFilesWithExt` revelated by this change,
where the project name was not set.
Remove the uniqueness constraint from Project name

The uniqueness constraint prevents the consumers to load the same
project (the project in the same directory) multiple times.

This commit also moves the definition & constraints of the `name`
property to models.json.
Implement ModelPropertyDefinition model.

Implement domain entity for working with model properties.

Refactory Project and ModelDefinition to use this new entity when
loading and saving `models.json`.
Merge pull request #47 from strongloop/feature/fix-uniqueness-validations-and-implement-property-definition-api

Fix uniqueness validations and implement model-property-definition API
Fix datasource config to remove stderr logs

Modify the datasource configuration to create default datasources
for types `db` and `mail`.

Before this change, `app.boot` was printing the following error:
{ name: 'AssertionError',
  actual: false,
  expected: true,
  operator: '==',
  message:
  'cannot autoAttach model "DataModel". No dataSource found of type db'
}
test: remove unneeded db cleanup

It is not necessary to remove Project/Model/DataSource definitions
created by previous tests, since the uniqueness validations are
correctly scoped now.
Project: implement `listAvailableConnectors`

The list is maintained in the file `available-connectors.json` for now.
PropertyDefinition: implement `availableTypes`

A list of types to offer when creating a new property.
Implement AclDefinition model.

Implement domain entity for working with model permissions.

Refactor Project and ModelDefinition to use this new entity when
loading and saving `models.json`.

Refactor Project > applyPermissions to use AclDefinition for adding
new permission records.

Add static value providers for accessType, role and permission.