Commit Graph

3434 Commits

Author SHA1 Message Date
biniam 2aa4d20394 4.7.0
* fix: allow coercion of nested properties (biniam)
2019-05-03 19:15:10 -04:00
Biniam Admikew 0b871d1de1
Merge pull request #1727 from strongloop/fix/nested-property-coercion-4x
fix: allow coercion of nested properties

Handle model definitions with nested property
definitions for coercion of primitive values.
2019-05-03 19:08:53 -04:00
biniam 9c94b9344b fix: allow coercion of nested properties
Handle model definitions with nested property
definitions for coercion of primitive values.
2019-05-03 18:45:39 -04:00
Miroslav Bajtoš 3fba79e725
4.6.4
* Fix tests for empty/default values to pass on SQL (Miroslav Bajtoš)
 * Update nyc to 14.0.0 (Miroslav Bajtoš)
 * test: define models in before hooks (biniam)
 * Update `should` to `13.2.3` (Miroslav Bajtoš)
 * Update `mocha` to `6.1.4` (Miroslav Bajtoš)
2019-05-03 09:04:42 +02:00
Miroslav Bajtoš 78c4bfbc2d
Merge pull request #1733 from strongloop/fix/postgresql
Fix tests for empty vs. default values to pass on SQL
2019-05-03 09:04:08 +02:00
Miroslav Bajtoš b0e3de1083
Fix tests for empty/default values to pass on SQL 2019-05-03 08:57:48 +02:00
Miroslav Bajtoš 08e8725ba5
Merge pull request #1732 from strongloop/update-nyc
Update nyc to 14.0.0
2019-05-02 13:24:58 +02:00
Miroslav Bajtoš 837c74d08e
Update nyc to 14.0.0 2019-05-02 13:01:10 +02:00
Biniam Admikew 6677c58cff
Merge pull request #1721 from strongloop/fix/failing-tests
test: define models properly
2019-04-30 11:50:10 -04:00
biniam eff6458a2a test: define models in before hooks
Re-work tests from #1702 based on the failures observed in #1719
and cherry-pick those commits back to master using ES6 syntax.
2019-04-30 11:15:23 -04:00
Miroslav Bajtoš 0bba44ee29
Merge pull request #1730 from strongloop/update-deps
Update `mocha` and `should` to latest
2019-04-30 12:10:34 +02:00
Miroslav Bajtoš 76673a8ed8
Update `should` to `13.2.3` 2019-04-30 11:44:08 +02:00
Miroslav Bajtoš 511c4763d3
Update `mocha` to `6.1.4` 2019-04-30 11:44:00 +02:00
Miroslav Bajtoš 88312422d8
4.6.3
* Add support for Node.js 12.x (Miroslav Bajtoš)
 * fix: coerce primitive properties on update (biniam)
 * fix: coerce date array properties (biniam)
 * fix: normalize include with boolean or number (spurreiter)
2019-04-30 10:52:46 +02:00
Miroslav Bajtoš 6793be20ca
Merge pull request #1728 from strongloop/chore/add-node-12
Add support for Node.js 12.x
2019-04-30 09:09:37 +02:00
Miroslav Bajtoš 5c3405eceb
Add support for Node.js 12.x
- Fix code to pass all tests on Node.js 12
- Add Node.js 12 to the list of Travis CI platforms
2019-04-29 09:46:57 +02:00
Biniam Admikew 47addd943a
Merge pull request #1702 from strongloop/fix/nested-property-resolution
fix: primitive data type coercion
2019-04-16 12:00:24 -04:00
biniam 48af738ec4 fix: coerce primitive properties on update 2019-04-16 10:51:44 -04:00
biniam 1534392c62 fix: coerce date array properties 2019-04-16 10:50:54 -04:00
Miroslav Bajtoš fe83f3cfd1
Merge pull request #1581 from spurreiter/include-crashes
fix: normalize include with boolean or number
2019-04-12 17:05:02 +02:00
jannyHou b3945fcd33 4.6.2
* chore: update CODEOWNERS (#1712) (Diana Lau)
 * fix: ignore git file (#1714) (Janny)
 * remove kv-extreme-scale ctor from downstream test (#1710) (Diana Lau)
2019-04-10 11:59:45 -04:00
Diana Lau 11f9c1f23a
chore: update CODEOWNERS (#1712) 2019-04-10 11:07:55 -04:00
Janny b4d89fc7c5
fix: ignore git file (#1714) 2019-04-10 10:51:21 -04:00
Diana Lau 7288277e87
remove kv-extreme-scale ctor from downstream test (#1710) 2019-04-10 10:20:38 -04:00
Miroslav Bajtoš 095fe62fa6
4.6.1
* Improve tests for empty vs. default values (Miroslav Bajtoš)
 * Do not apply default values on data from database (Miroslav Bajtoš)
 * Update datasource-connector.md (#1703) (Jam Risser)
 * feat: support array within array (Hage Yaapa)
 * fix: update lodash (#1696) (Janny)
2019-04-09 18:20:02 +02:00
Miroslav Bajtoš a8d0d78913
Merge pull request #1707 from strongloop/test/fix-default-values
Improve tests for empty vs. default values
2019-04-09 18:12:40 +02:00
Miroslav Bajtoš 7d69bdab70
Improve tests for empty vs. default values 2019-04-09 15:54:52 +02:00
spurreiter 55b10a43c4 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-05 19:02:57 +02:00
Miroslav Bajtoš 84eee5a69e
Merge pull request #1704 from strongloop/fix/default-value-in-response
fix: do not apply default values on data from database
2019-04-04 10:10:23 +02:00
Miroslav Bajtoš e45292de08
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 fixing DAO operations like `find` and
`findOrCreate` so that they do NOT apply default property values on
data returned by the database (connector).

Please note that most of the other CRUD methods were already not
applying default values on database data as long as the connector
provided native implementation of the operation.
2019-04-04 09:47:31 +02:00
Jam Risser ff5a3fa8bf Update datasource-connector.md (#1703)
Corrected typo in docs
2019-03-28 16:34:35 -04:00
Hage Yaapa 3f9448f5d2
Merge pull request #1699 from strongloop/fix/list-format
feat: support array within array
2019-03-19 19:06:08 +05:30
Hage Yaapa 80d8fcd8b1 feat: support array within array 2019-03-07 15:58:26 +05:30
Janny 5a7c0326ab
fix: update lodash (#1696) 2019-03-01 14:29:56 -05:00
Diana Lau ce7194ff6a 4.6.0
* feat: Support "type" key in sub-properties (Hage Yaapa)
 * fix: use correct callback for geo find queries (biniam)
 * fix: update typescript declarations (biniam)
2019-02-26 14:27:50 -05:00
biniam 75a8c6a309 4.5.4
* fix: use correct callback for geo find queries (biniam)
 * fix: update typescript declarations (biniam)
2019-02-26 14:22:13 -05:00
Hage Yaapa 01df3705d1
Merge pull request #1693 from strongloop/feat/type-sub-property
feat: Support "type" key in sub-properties
2019-02-26 20:49:52 +05:30
Hage Yaapa a391c83a2c feat: Support "type" key in sub-properties 2019-02-21 13:58:34 +05:30
Biniam Admikew 70b3bb6aae
Merge pull request #1690 from strongloop/fix/near-filter-cb
Fix callback for find queries with near filters
2019-02-15 11:00:30 -05:00
biniam 5e0c73bec7 fix: use correct callback for geo find queries 2019-02-14 15:45:13 -05:00
Biniam Admikew c7d23d18d0
Merge pull request #1654 from strongloop/fix/types
fix: update typescript declarations
2019-01-31 00:33:19 -05:00
biniam 4b705b127c fix: update typescript declarations 2019-01-31 00:29:35 -05:00
Miroslav Bajtoš 4d288813e2
4.5.3
* Support nested properties with class type (Miroslav Bajtoš)
2019-01-29 15:51:58 +01:00
Miroslav Bajtoš c0a778eeab
Merge pull request #1670 from up-group/master
Enable to target ES6
2019-01-29 15:50:56 +01:00
Miroslav Bajtoš fd99c6dc6e
Support nested properties with class type
When converting plain-data object values into model instances,
correctly handle the case where the constructor functions is a class
constructor and must be invoked via `new`.
2019-01-25 10:05:36 +01:00
Miroslav Bajtoš 4c69781504
4.5.2
* Improve Model type definitions (Miroslav Bajtoš)
 * fix: use existing field in exclude test (biniam)
2019-01-24 16:55:49 +01:00
Miroslav Bajtoš 928747f795
Merge pull request #1685 from strongloop/fix/type-defs
Improve Model type definitions
2019-01-24 16:54:37 +01:00
Miroslav Bajtoš 81fc722b72
Improve Model type definitions
Define two new types: ModelSettings and ModelProperties to describe the
objects describing model properties and settings.

Add static property `base` and static method `extend` to the definition
of `ModelBase` class.

Add property `defaultModelBaseClass` to `ModelBuilder` class definition.

Fix `PropertyDefinition` interface: remove `name`, add optional `id`.
2019-01-24 16:27:40 +01:00
Biniam Admikew 0ec951ee11
Merge pull request #1682 from strongloop/fix/include-test
fix: use existing field in exclude test
2019-01-16 14:33:55 -05:00
biniam 0b81425a13 fix: use existing field in exclude test
Co-authored-by: Raymond Feng <rfeng@us.ibm.com>
2019-01-16 13:24:27 -05:00