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.
Refactor tests to stop sharing global models between different test
suites and use local per-app model registry instead.
Also clean up all test code to use `const` and `let` instead of `var`.
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 unit-tests to always reference the remote connector via
require('..') instead of depending on the remote connector
bundled in loopback, which is quite often an older version.
Without this the client may attempt to connect to 'localhost' which may
resolve to the IPv6 equivalent of '0.0.0.0', which is '::', which is
only useful listening on and not so useful for connecting too.