Commit Graph

2513 Commits

Author SHA1 Message Date
Samuel Reed 351f001652 fix(security): avoid prototype pollution on model create and update (#1805) 2019-12-16 11:01:18 -05:00
Janny bc82f2e7a8
fix: model coerce (#1806) 2019-12-13 01:33:58 -05:00
Miroslav Bajtoš c7535ff67c
2.59.2
* fix: normalize include with boolean or number (spurreiter)
2019-04-15 12:50:22 +02:00
Miroslav Bajtoš 18da6bce7c
Merge pull request #1718 from strongloop/fix/include-crash-2x
fix: normalize include with boolean or number
2019-04-15 12:49:03 +02:00
spurreiter aff2318c41
fix: normalize include with boolean or number
- On include = true or include = 1 the lib crashes with
  "TypeError: includes.forEach is not a function".
- checking for boolean and number type and return empty array.
- fix: include symbol and function in normalization
- fix: review changes; adding debug stmt + early exit for tests
2019-04-15 11:53:41 +02:00
jannyHou 3965078f76 2.59.1
* fix: ignore .git folder (#1709) (Janny)
2019-04-09 16:07:38 -04:00
Janny 41e8a318d8
fix: ignore .git folder (#1709) 2019-04-09 15:57:33 -04:00
Miroslav Bajtoš 58613fa240
2.59.0
* Do not apply default values on data from database (Miroslav Bajtoš)
 * feat: Support "type" key in sub-properties (Hage Yaapa)
2019-04-09 18:17:21 +02:00
Miroslav Bajtoš ddd483ac3b
Merge pull request #1706 from strongloop/fix/default-value-in-response-2x
Do not apply default values on data from database
2019-04-09 18:16:34 +02:00
Miroslav Bajtoš a647bb0736
Do not apply default values on data from database
Before this change, when a property was configured with a default value
at LoopBack side and the database was returned a record with a missing
value for such property, then we would supply use the configured
default.

This behavior is problematic for reasons explained in #1692.

In this commit, we are introducing a new model-level setting called
`applyDefaultsOnReads`, which is enabled by default for backwards
compatibility.

When this setting is set to `false`, operations like `find` and
`findOrCreate` will NOT apply default property values on data returned
by the database (connector).

Please note that most of the other CRUD methods did not apply default
values on database data as long as the connector provided native
implementation of the operation, that aspect is not changing.

Also note that default values are applied only on properties with
`undefined` values. The value `null` does not trigger application of
default values. This is important because SQL connectors return
`null` for properties with no value set.
2019-04-09 15:46:09 +02:00
Hage Yaapa 905fa20c36
Merge pull request #1697 from strongloop/2x/type-sub-property
feat: Support "type" key in sub-properties in 2.x
2019-03-19 19:05:03 +05:30
Hage Yaapa 8c99e841ff feat: Support "type" key in sub-properties 2019-03-05 23:49:25 +05:30
Miroslav Bajtoš 4e65e59f1a
2.58.1
* Describe LTS versions in README (Miroslav Bajtoš)
2018-10-08 15:24:45 +02:00
Miroslav Bajtoš 3bbc7a1661
Merge pull request #1634 from strongloop/update-lts-2x
Describe LTS versions in README
2018-10-08 09:01:02 +02:00
Miroslav Bajtoš da64803fe8
Describe LTS versions in README 2018-10-08 08:40:11 +02:00
Miroslav Bajtoš 1c1b0caa69
2.58.0
* feat: omit default fn for embeds many (jannyHou)
2018-07-31 09:27:34 +02:00
Miroslav Bajtoš e7583da285
Merge pull request #1615 from strongloop/backport-omitDefaultEmbeddedItem
feat: omit default fn for embeds many
2018-07-31 09:25:52 +02:00
jannyHou 9a5bd51db5
feat: omit default fn for embeds many 2018-07-30 12:54:51 +02:00
Miroslav Bajtoš f8c5b257f0
2.57.0
* Add support for Node.js 8.x and 10.x, drop 4.x (Miroslav Bajtoš)
2018-05-18 18:18:56 +02:00
Miroslav Bajtoš cc685989a3
Merge pull request #1584 from strongloop/fix/supported-node-versions
Add support for Node.js 8.x and 10.x, drop 4.x [2.x]
2018-05-18 18:18:14 +02:00
Miroslav Bajtoš b056255ecd
Add support for Node.js 8.x and 10.x, drop 4.x
Also remove a flaky test assertion that reports different results
on different Node.js versions. This assertion has been already
removed on `master` branch (3.x version line).
2018-05-18 17:26:47 +02:00
Kevin Delisle 9917e1d283 2.56.0
* fix unauthorized fk change (#1540) (Taranveer Virk)
 * drop support for node 0.10 / 0.12 (#1541) (Taranveer Virk)
2018-01-19 12:55:59 -05:00
Taranveer Virk 2167e802a9
fix unauthorized fk change (#1540) 2018-01-19 12:48:56 -05:00
Taranveer Virk b26da798a9
drop support for node 0.10 / 0.12 (#1541)
Drop support for Node 0.10/0.12 as it’s not supported by Node and tests
are failing since our dependencies no longer support Node 0.10/0.12
2018-01-19 11:28:31 -05:00
Kevin Delisle 60a47b4439 2.55.3
* fix(model-builder): __data may be null. (#1415) (Samuel Reed)
 * package: use qs@6.5.0 (#1470) (Kevin Delisle)
2017-09-26 16:41:31 -04:00
Samuel Reed 40e278ab96 fix(model-builder): __data may be null. (#1415)
This error was swallowed by strong-remoting try/catch
in eachRemoteFunctionInObject()
2017-09-26 16:37:51 -04:00
Kevin Delisle 7c196af109 package: use qs@6.5.0 (#1470)
Fix for advisory: https://snyk.io/vuln/npm:qs:20170213
2017-08-23 15:16:45 -04:00
Kevin Delisle 83d9b865d5 2.55.2
* Fix #1434 2.55.1 Throws when using where query against "JSON Object or ANY" Type (#1444) (Shing)
 * castPropertyValue: throw on malformed types (Kevin Delisle)
2017-07-28 16:33:46 -04:00
Shing 88771f10fc Fix #1434 2.55.1 Throws when using where query against "JSON Object or ANY" Type (#1444)
* Test for JSON object or any type

* dao.js coercion type.definition existence check
2017-07-28 16:30:49 -04:00
Kevin Delisle 29676f6510 Merge pull request #1441 from strongloop/memory/throw-on-malformed-types
castPropertyValue: throw on malformed types
2017-07-28 16:26:16 -04:00
Kevin Delisle f3b849bb47 castPropertyValue: throw on malformed types 2017-07-28 12:50:51 -04:00
Kevin Delisle e63bbcf9cd 2.55.1
* Catch errors using cb (loay)
 * Recursively cast props on fromDb for memory conn. (nVitius)
 * Recursively coerce nested properties in dao (nVitius)
 * Fix #1079 - Polymorphic hasMany inverse relation (#1296) (Janny)
2017-07-21 14:12:10 -04:00
Loay 9096e0873e Merge pull request #1433 from strongloop/create-update-pass
Catch errors using cb
2017-07-21 12:27:48 -04:00
loay 63f04a28d4 Catch errors using cb 2017-07-21 10:13:16 -04:00
Sakib Hasan 1d8ca908f6 Merge pull request #1361 from nVitius/Fix/2.x/NestedProperties
Fix/2.x/nested properties
2017-07-13 21:34:01 -04:00
nVitius 3df1826730 Recursively cast props on fromDb for memory conn.
In the fromDb step, nested properties weren't being hydrated properly.
This caused an issue with the ability to search on such properties as
Dates. The properties would be hydrated as a String type, and as such,
it was impossible to properly query on them.
2017-07-12 12:51:19 -07:00
nVitius 8ebccb65d1 Recursively coerce nested properties in dao 2017-07-11 12:55:01 -07:00
Janny 6d017c1e34 Fix #1079 - Polymorphic hasMany inverse relation (#1296)
This fixes the polymorphic hasMany inverse relation
not working as expected in include filters.
2017-07-11 15:47:32 -04:00
Kevin Delisle da323964f5 2.55.0
* Backport - Apply hasManyThrough filter on target model (#1404) (Janny)
2017-07-10 16:39:03 -04:00
Janny 2190f2510f Backport - Apply hasManyThrough filter on target model (#1404)
* Apply hasManyThrough filter on target model

* Compatible with mongodb
2017-06-22 16:51:10 -04:00
Kevin Delisle 5a661a064a 2.54.2
* Fix assert as array does not guarantee order (Candy)
 * Fixed empty objList in linkOneToMany fn (#1287) (somename85)
 * remove equality value for user-defined id (#1292) (Matteo Padovano)
 * override collection name for arangodb (#1274) (Matteo Padovano)
 * fix missing findOrCreate error callback (Ryan Graham)
2017-06-13 12:37:24 -04:00
Candy 4ebc421c11 Merge pull request #1367 from strongloop/fix_testcase_order
Fix assert as array does not guarantee order
2017-05-23 13:45:42 -04:00
Candy 3e02e36314 Fix assert as array does not guarantee order 2017-05-05 16:14:17 -04:00
somename85 cbb3f6f98a Fixed empty objList in linkOneToMany fn (#1287) 2017-04-05 10:27:34 -04:00
Matteo Padovano 93b89f3a51 remove equality value for user-defined id (#1292)
Some connector, like arangodb, not support id as Number.
 When `forceId` is set to true and id is set `Model.isValid`
 report error and the field id is not coerced.
2017-04-04 13:15:19 -04:00
Matteo Padovano 570da781b8 override collection name for arangodb (#1274)
Add collection name settings for arangodb database.
Required to pass common tests included in community connector
2017-03-25 18:22:59 -04:00
Ryan Graham e9baea77e0
fix missing findOrCreate error callback
Closes #1226
Resolves #1223

Signed-off-by: Ryan Graham <r.m.graham@gmail.com>
2017-03-16 18:32:47 -07:00
Miroslav Bajtoš 7d45463a22
2.54.1
* fix incorrect engines property in package.json (Ryan Graham)
 * Fix datasource to report connector-loading errors (Miroslav Bajtoš)
 * Add two basic tests for "inq" operator (Miroslav Bajtoš)
2017-03-13 16:16:57 +01:00
Ryan Graham f7af629e96 Merge pull request #1263 from strongloop/fix-engines-2.x
fix incorrect engines property in package.json
2017-03-03 13:08:59 -08:00
Ryan Graham 5cbc3bfae7
fix incorrect engines property in package.json 2017-03-03 12:56:56 -08:00