Commit Graph

21 Commits

Author SHA1 Message Date
Agnes Lin 59f70ab3ce chore: update copyrights years 2019-05-07 13:34:15 -04:00
Jannis Ötjengerdes 4108db8945
fix: return null when findById/findOne returns 404
Co-authored-by: Maxim Sharai <maxim.sharai@tispr.com>
Co-authored-by: Jannis Ötjengerdes <joetjengerdes@rightmart.de>
2019-01-21 16:32:41 +01:00
Miroslav Bajtoš 60c081f893
chore: update copyright notice years 2018-01-16 15:55:09 +01:00
maxim.sharai af125c50cc
Fix duplicate definition of a remote model type
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.
2018-01-16 15:15:45 +01:00
Dimitris a3d110b78c
Preserve related models from "include" filter
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.
2017-12-12 09:39:37 +01:00
Miroslav Bajtoš 55cb88f727
Add eslint to npm test, fix linter issues 2017-12-11 14:51:48 +01:00
Kenny Sabir 816e989b4e
Add support for configuring remoting options
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.
2017-12-05 14:22:10 +01:00
Miroslav Bajtoš bce99713c1 Use the new API for defining remoting types 2016-09-09 09:50:22 +02:00
Miroslav Bajtoš 3f3d32a556 lib: use strict, fix whitespaces 2016-09-01 11:54:34 +02:00
Ryan Graham 17e60c9351
update copyright notices and license 2016-05-06 12:02:21 -07:00
Heath Morrison 75fd2f42f3 Small logic cleanup 2016-04-25 01:11:05 +03:00
Heath Morrison a4e825191f Added promise support 2016-04-25 01:07:15 +03:00
Miroslav Bajtoš 0fd7bf06b5 Register Models with Dynamic converter
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.
2016-01-26 15:13:09 +01:00
Geoffroy ba1703fbea Clean up tests 2016-01-07 20:08:05 -08:00
Simon Ho 2b3f5171fe Create proxy methods for aliases 2015-03-28 11:39:49 -07:00
Ritchie Martori f02d71be1f Add include mixin 2014-12-19 14:30:56 -08:00
Miroslav Bajtoš 61a4dd939f Fix support for browsers
Use `process.nextTick` instead of `setImmediate`, as the latter is
not a standard API.

https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate
2014-10-10 10:29:23 +02:00
Ritchie Martori bf94e0a53f Call resolve when defining Models 2014-10-01 14:36:34 -07:00
Krishna Raman 3db9e34cc4 Fix relation access via remote connector 2014-09-25 15:17:55 -07:00
Krishna Raman 2df5b726b1 Fix formatting 2014-09-25 14:20:26 -07:00
Krishna Raman 724fd7d99c Move remote connector from loopback 2014-09-25 14:20:22 -07:00