- Add jest matcher (#150)
- Validate literal regular expression (#146).
- Add support for the
query
variable (#142).
Thanks to @a-xin to implementing the new plugin and for his help troubleshooting RexExp validation.
- Allow dot in literal regexp (#148); Thanks @a-xin for notice it.
- Support literal closing bracket (#149).
- Publish generated regexp parser; Thanks @a-xin for notice it.
- Validate literal regular expression (#146).
- Add support for the
query
variable (#142).
- Fix regression in v3.0.3 regarding invalid location in rules evaluation - should have been allowed (#136).
Thanks to @chetbox for reporting the issue.
- Fix handling of trailing slashes in update operation patch data keys (#134).
Thanks to @SamyPesse for reporting the issue.
- Fix handling of tests with invalid locations (#131).
Thanks to @dannycochran for reporting the issue.
- Fix falsy member property evaluation (#125);
foo.bar
would have evaluated tofoo
iffoo.bar
had been falsy (e.g. an empty string). - Fix patch example (#123).
Thanks to @SamyPesse and @a-xin for their contributions.
Thanks to @pthrasher for his contribution.
- Fix type validation:
- Type inferring doesn't throw when it cannot infer a node type; set the type to "any" or "primitive".
- Type inferring of each side of a binary expression, or of method argument accepts "any" or "primitive" and delay type validation until evaluation.
- Validate type of string and snapshot method arguments during evaluation.
- Validate type of each sides of binary expression during evaluation: most arithmetic expressions require numbers, addition also accept operation on string, comparison require string, number or null, equality operations require a primitive or a plain Object.
- Add live testing for Firebase parity.
- Stop evaluating child write rules.
- Add more debugging info.
- Fix snapshot root parent access.
- Fix data node snapshot priority handling.
- Refactor API:
- Plugins scripts should be imported directly, e.g.
require('targaryen/plugins/chai')
:- Add
targaryen/plugins/chai
. - Add
targaryen/plugins/jasmine
. - Deprecate
targaryen.chai
. - Deprecate
targaryen.jasmine
. - Deprecate
targaryen.setFirebaseData
. - Deprecate
targaryen.setFirebaseRules
. - Deprecate
targaryen.setDebug
. - Deprecate
targaryen.users
.
- Add
- Simpler API to use targaryen directly:
- Add
targaryen.database(rules: object|Ruleset, data: object|DataNode, now: null|number): Database
. - Add
targaryen.util
functions used by the CLI and the reference plugins for chai and jasmin - Remove
targaryen.Ruleset
. - Remove
targaryen.DataSnapshot
. - Remove
targaryen.helpers
.
- Add
- Plugins scripts should be imported directly, e.g.
- Refactor internal:
- Refactor data access and Ruleset.
- Refactor public api.
- Format source based on eslint xo shared configuration.
- Refactor rule parser.
- Simpler tests.
- Move
lib/database
. - Fix deleting a missing node.
- Add
DataNode.$merge
(Database.root.$merge
). - Better debug info when an operation doesn't trigger any read/write rules.
- Fix regression bug in removing and prune nodes.
- Describe operation in result info (were previously generated by error helpers in
targaryen.utils
).
- Targaryen CLI can parse rules containing multi lines string (would previously only support comments).
- Chai and jasmine plugins include json parser helpers (supporting comments and multi line strings)
Thanks goes to @alisson446, @georgesboris, @mhuebert, @RomansBermans and @simenbrekken for their contributions.
Thanks to @RomansBermans for reporting the issue.
Thanks to @RomansBermans and @simenbrekken for spotting the issue.
- Fix npm description
- Expose Ruleset, DataSnapshot and helpers.
- Write operations now replace nodes instead of merging them.
- Fix initial timestamps; The timestamp used to replace a server value will match the
now
variable in rule tests. - Fix parsing rules with unknown identifers.
- Fix
Ruleset#tryWrite
returningdata
andnewData
as a value instead of a snapshot. - Fix inconsistence between Ruleset's
tryRead
,tryWrite
, andtryPatch
returned result: they now all return a root and data snapshot, and a newRoot and newData snapshot when appropriate. - Prune off null value and empty node after any update.
- Partially fix type inference while building the rules.
- Fix missing auth properties evaluation.
- Fix evaluation error handling in write/patch operations.
- Fix evaluation of computed member expression.
setFirebaseData
gains anow
parameter:targaryen.setFirebaseData(data[, now]);
.- jasmine matchers gain an optional
now
parameter. - chai plugin
write
andpatch
methods gain an optionalnow
parameter. - chai plugin gains a
readAt(now)
method.
Thanks goes to @georgesboris and @mhuebert for their contributions.
- Properly merge literal value nodes (including null); a node would have been set to null but it's - deleted - children would still have been validated with their old value.
- Skipping validation of node set to null would skip validation of sibling nodes; this is now fixed.
- Treat empty objects as null. Thanks to @mhuebert.
Starting from this release, Node.js version 0.12 is no longer supported. Please use 2.1 for Node versions 0.12 and below.
- Wildcards are now correctly propagated at multiple levels. Thanks to @dinoboff.
- Support for testing update operations, including multi-location updates. Thanks to @dinoboff.
- .validate rules are now ignored during delete operations, reflecting the actual behavior of Firebase. Thanks to @matijse. Fun fact: "ij" is a single letter in Dutch.
- "JSON comments" in rules files are now correctly ignored, reflecting the actual behavior of Firebase. Thanks to @sebastianovide.
- The .priority key was inadvertently overwritten under some conditions; this is now fixed.. Thanks to @matijse.
- You can now use unauthenticated users in CLI testing. Thanks to @jbearer.
- newData is now correctly merged with existing root state. Fixes a bug demonstrated by @bijoutrouvaille. Thanks to @ibash for fixing it.
- Nested variables in rules. Thanks to @petrusek.
- Fix validate rules running on null. Thanks to @jtwebman.
- Major version bump that should have happened in association with #14. Sorry about that.
- Fixed a bug in parsing binary expressions (#18). Thanks to @CurtisHumphrey.
- You can now use leading
/
in tests. Thanks to @CurtisHumphrey for this.