Commit Graph

644 Commits

Author SHA1 Message Date
Miroslav Bajtoš 4d7154a31a app: send port:0 instead of port:undefined
Node v6 no longer supports port:undefined, this commit is fixing
app.listen() to correctly send port:0 when no port is specified.
2016-05-03 16:20:07 +02:00
Miroslav Bajtoš 87bbf4502a Remove "loopback.autoAttach()"
The method was deprecated since LoopBack 2.0, there is no need to keep
it around in 3.0.
2016-05-03 14:01:39 +02:00
Simon Ho d16c789638 Fixes for emit `remoteMethodDisabled` PR
See https://github.com/strongloop/loopback/pull/2266#issuecomment-215689358
2016-04-29 16:42:13 -07:00
Supasate Choochaisri 0ca24389b2 Add new feature to emit a `remoteMethodDisabled` event when disabling a remote method.
Signed-off-by: Supasate Choochaisri <supasate.c@gmail.com>
2016-04-28 09:03:54 +07:00
Tim Needham 159aaf5afa Fix typo in Model.nestRemoting
Prevent apps from crashing when using `Model.nestRemoting` without
`{ hooks: false }` option.

Note that it is not possible to reproduce this bug using our current
Mocha test suite, because other tests modify the global state in such
way that the bug no longer occurs.
2016-04-19 16:51:52 +02:00
Rand McKinney 58f32dd70e Update loopback.js
Update comment line that was creating invalid info in API docs.
2016-04-18 09:42:56 -07:00
Rand McKinney 88d41f84fd Merge pull request #2155 from sghung/master
Fix inconsistencies in JSDoc
2016-04-06 16:01:31 -07:00
Miroslav Bajtoš f9702b0ace Use eslint with loopback config
Drop jshint and jscs in favour of eslint.

Fix style violations.

While we are at this, reduce the max line length from 150 to 100.
2016-04-06 10:45:30 +02:00
Jue Hou eb09681f21 promise docs
Add promise jsdoc in loopback
2016-04-04 12:35:35 -04:00
sghung@ca.ibm.com d69ab1e411 Update JSDoc 2016-04-01 14:00:01 -04:00
Candy b5b900e0ff Remove constraint making isStatic required 2016-03-30 11:16:32 -04:00
Simon Ho b4e230389d Merge pull request #1780 from linguofeng/patch-1
Update persisted-model.js
2016-03-22 16:10:22 -07:00
sghung@ca.ibm.com 3302391ac7 Fix inconsistencies in JSDoc 2016-03-17 23:55:12 -04:00
Miroslav Bajtoš 93d487ffc0 Improve error message on connector init error 2016-02-26 14:46:26 +01:00
Sam Roberts b9acace932 application: correct spelling of "cannont" 2016-02-18 20:36:07 -08:00
Miroslav Bajtoš 804c71d7c6 Remove "loopback.DataModel"
The model was just a temporary alias to simplify migration of code
based on <=2.0.0-beta3
2016-01-25 10:17:45 +01:00
Chris Coggburn 7252c7686c Correct JSDoc findOrCreate() callback in PersistedModel
Update PersistedModel.findOrCreate() JSDoc to reflect the callback accepts an additional created boolean parameter.
2016-01-21 20:40:19 -07:00
Amir Jafarian 08a2786b04 Checkpoint speedup 2016-01-09 01:56:13 -05:00
Jue Hou 889c561ed3 Always use bluebird as promise library
Replace `global.Promise` with `bluebird`
2016-01-08 13:58:12 -05:00
Simon Ho e8179e119d Fix failing tests
JSCS is detecting improper whitespaces lib/persisted-model.js.
2015-12-31 14:04:09 -08:00
Rand McKinney 1af03613cc Update persisted-model.js
- Correct doc for findOrCreate.
- Fix indentation
- Remove quotes in example `where`
- Fix typo
- Fix spacing in notional where clause
2015-12-22 17:08:19 -08:00
Amir Jafarian 4aac2776a8 Fix bulkUpdate to not trigger rectifyAll
Fix `getIdFromWhereByModelId()` to correctly detect the situation
when "bulkUpdate" performs a write operation using a where filter
containing both id attribute but also all other model attributes.

This should significantly improve the performance of change replication,
because the cost of running rectifyAll is very high.
2015-12-22 10:44:28 +01:00
Miroslav Bajtoš 5e4bf1dd25 PersistedModel: log rectify/rectifyAll triggers
Add debug logging to identify what operations trigger rectify and
rectifyAll calls.
2015-12-17 14:13:47 +01:00
Rand McKinney 17abd8ac76 Update model.js
*Add doc comments for nestRemoting
*change cb to filterCallback in nestRemoting
2015-12-04 19:24:03 -05:00
Richard Pringle 03c8d044ad Fix typo in description of persistedModel.updateAttributes() 2015-11-11 16:54:21 -05:00
Miroslav Bajtoš 36cd5a7a78 lib/registry: fix findModel for model ctor
Fix `registry.findModel(arg)` to support the case when `arg` is already
a model constructor.
2015-11-09 16:01:43 +01:00
linguofeng 4717fb3dbd Update persisted-model.js
`find` to `findById`
2015-10-28 12:48:36 +08:00
Rand McKinney 32085475ed Fix typo in doc comment 2015-10-21 13:47:36 -07:00
Simon Ho 26af1472e7 Check configs for shared method settings 2015-09-28 16:27:48 -07:00
Miroslav Bajtoš c87bf9a1da Merge pull request #1681 from strongloop/fix/replication-perf-on-save
Fix perf of rectification after updateAttributes
2015-09-18 17:05:14 +02:00
Miroslav Bajtoš 89326c7630 Fix perf of rectification after updateAttributes
Improve the id-detection algorithm in the "after save" hook
to correctly handle "updateAttributes" as a single-model change
and DO NOT trigger full "rectify all" scan.
2015-09-17 19:23:00 +02:00
Rand McKinney 8d02e42cf3 Update persisted-model.js
Remove trailing whitespace.
2015-09-09 16:08:20 -07:00
Rand McKinney 3821824c97 Update persisted-model.js
Fix links in API docs to docs for where filter
2015-09-09 15:46:53 -07:00
Richard Walker 65ca318392 Create stack-removing errorhandler middleware
Create a wrapper around express' errorhandler that removes the stack
trace from error responses when "options.includeStack" is false.
2015-09-03 08:38:24 +02:00
Miroslav Bajtoš bab1d5dae8 Merge pull request #1632 from gausie/patch-2
Allow EJS templates to use includes
2015-08-31 18:15:16 +02:00
Samuel Gaus ecc98fd29c Allow EJS templates to use includes
Simple change that allows templates to use includes.
2015-08-27 16:37:04 +01:00
Christoph c2eb8e754d fix typo "PeristedModel" 2015-08-14 01:49:27 +02:00
Pradnya Baviskar 64a1dbadc8 Promisify 'PersistedModel - replication' 2015-08-12 09:22:53 +02:00
Raymond Feng c44a19dc73 Allow methods filter for middleware config 2015-08-05 10:30:57 -07:00
Miroslav Bajtoš 98784e2b4b Don't load Bluebird for createPromiseCallback
The decision which Promise implementation to use should be made by
LoopBack user, not by the framework.

This commit moves Bluebird reference from lib/utils.js to
test/support.js.
2015-08-04 11:04:12 +02:00
Miroslav Bajtoš aa5c9e3628 Merge pull request #1493 from PradnyaBaviskar/issue418-userModel
Promisify User model
2015-08-04 10:32:44 +02:00
Raymond Feng 0f9dd93aba Fix jsdocs for methods with where argument 2015-07-28 08:29:43 -07:00
Pradnya Baviskar dc987a59a9 Promisify User model 2015-07-14 13:01:46 +05:30
Ritchie Martori 9422175510 Add link to createChangeStream docs 2015-07-13 09:40:22 -07:00
Ritchie Martori cdddb08a67 Merge pull request #1445 from strongloop/feature/subscribe
Add PersistedModel.subscribe()
2015-07-09 13:35:49 -07:00
Ritchie Martori 40c5707a36 Add PersistedModel.createChangeStream() 2015-07-09 13:34:01 -07:00
Ritchie Martori 503eb948b7 Remove trailing whitespace from jsdoc 2015-07-08 16:53:51 -07:00
Rand McKinney ae7c12552a Update model.js
Updated JSdoc for remoteMethod
2015-07-07 11:01:50 -07:00
Miroslav Bajtoš 3115e5055f Auto-configure models required by `app.enableAuth`
Modify `app.enableAuth` to automaticaly setup all required models
that are not attached to the app nor a datasource.

Users wishing to use this option must provide the name of the
data-source to use for these models.

Example usage:

    var app = loopback();
    app.dataSource('db', { connector: 'memory' });
    app.enableAuth({ dataSource: 'db' });

    app.use(loopback.rest());
    app.listen(3000);
2015-06-01 12:19:28 +02:00
Miroslav Bajtoš 0ccc1e2b73 Add loadBuiltinModels flag to loopback(options)
When creating an application with a local registry, the default
behaviour is to define only two core models Model & PersistedModel.

The new flag `loadBuiltinModels` modifies this behaviour and instructs
loopback to define all builtin models in the local registry too.
2015-06-01 12:19:28 +02:00