Before this commit, when a remote model had relations, the model was
registered an additional time per each relation. As a result,
the following warnings were printed to the console
Warning: overriding remoting type $MODEL_NAME
This commit fixes registration of models with strong-remoting to avoid
those warnings.
Before this change, when making a remote call with "include" filter
(for example `findById(11, {include:['children']})`), the related
models were removed from the result.
This commit fixes the implementation to correctly preserve related
models and also to cast them to correct model instances.
Allow remote-connector users to provide "options" property in the
datasource configuration, this "options" object is then passed down to
RemoteObjects and allows e.g. configuration of pass-through
authorization, where the remoting connector passes the access token
used to make the incoming request down to the backend service invoked.
Fix `RemoteConnector.prototype.resolve` to register new models with
strong-remoting's `Dynamic` type resolver.
Before this change, if loopback-connector-remoting ended up with its
own copy of strong-remoting, then the responses were not converted
from plain objects to model instances, because model converters
were registered with the other instances of strong-remoting.
This has a side-effect that when there is only one strong-remoting
instance in the app, then there will be multiple converters registered
for the same model. Since the code performing conversion takes into
account the first model only, this should not pose any issues.