* Adds jobs endpoint protected by masterKey
* Adds connection timeout for 15 minutes in jobs
* Refactors pushStatusHandler into StatusHandler
* Adds reporting of _JobStatus
* Only accept strings as messages
* Adds test for masterKey basic auth
* Adds CloudCodeRouter for cloud_code endpoint of job status, enable Jobs feature on dashboard
* xit racing test
* Make parse-server cloud code logging much to parse.com legacy. (fixes#2501)
1. More closely mimic the wording. Include the user id.
2. Truncate input and result at 1k char.
3. Use more sensible metadata that would makes sense to index. The guideline I used was: if it makes sense to filter on, put it in metadata. If it makes sense to "free text" search on, then put it in the message.
- file and console output, logging an object does not do what on might expect. For example, logging a function's "params":
```
expected:
info: Ran cloud function aFunction for user qWHLVEsbEe with:
Input: {"foo":"bar","bar":"baz"}
Result: "it worked!" functionName=aFunction, params= { foo: "bar", "bar": baz }, user=qWHLVEsbEe
what you actually get:
info: Ran cloud function aFunction for user qWHLVEsbEe with:
Input: {"foo":"bar","bar":"baz"}
Result: "it worked!" functionName=aFunction, foo=bar, bar=baz, user=qWHLVEsbEe
```
- logging highly variable metadata is pretty useless for indexing when logs are sent to a logging repository like elastic search. In that use case, you want to index stuff you expect to filter on like user, hook type.
- finally, putting the same input and result data in both the metadata and the message makes each message much larger with no additional value (that I know of anyway :).
4. Change some of the naming of functions in trigger.js to make future work easier. I was confused about why there were three logging functions in trigger and it took me awhile to get that before hooks and after hooks are logged differently. I just changed the names to make it obvious at first glance.
5. Add some try/catches to help any future futzers see syntax errors, etc instead of just hanging.
Some log examples from unit test output:
```
info: Ran cloud function loggerTest for user YUD2os1i5B with:
Input: {}
Result: {} functionName=loggerTest, user=YUD2os1i5B
info: beforeSave triggered for MyObject for user nssehQ3wtz:
Input: {}
Result: {} className=MyObject, triggerType=beforeSave, user=nssehQ3wtz
info: afterSave triggered for MyObject for user XdznQgTD0p:
Input: {"createdAt":"2016-08-19T01:11:31.249Z","updatedAt":"2016-08-19T01:11:31.249Z","objectId":"POoOOLL89U"} className=MyObject, triggerType=afterSave, user=XdznQgTD0p
error: beforeSave failed for MyObject for user 7JHqCZgnhf:
Input: {}
Error: {"code":141,"message":"uh oh!"} className=MyObject, triggerType=beforeSave, code=141, message=uh oh!, user=7JHqCZgnhf
info: Ran cloud function aFunction for user YR3nOoT3r9 with:
Input: {"foo":"bar"}
Result: "it worked!" functionName=aFunction, user=YR3nOoT3r9
error: Failed running cloud function aFunction for user Xm6NpOyuMC with:
Input: {"foo":"bar"}
Error: {"code":141,"message":"it failed!"} functionName=aFunction, code=141, message=it failed!, user=Xm6NpOyuMC
info: Ran cloud function aFunction for user CK1lvkmaLg with:
Input: {"longString":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lobortis semper diam, ac euismod diam pharetra sed. Etiam eget efficitur neque. Proin nec diam mi. Sed ut purus dolor. Nulla nulla nibh, ornare vitae ornare et, scelerisque rutrum eros. Mauris venenatis tincidunt turpis a mollis. Donec gravida eget enim in luctus.\n\nSed porttitor commodo orci, ut pretium eros convallis eget. Curabitur pretium velit in odio dictum luctus. Vivamus ac tristique arcu, a semper tellus. Morbi euismod purus dapibus vestibulum sagittis. Nunc dapibus vehicula leo at scelerisque. Donec porta mauris quis nulla imperdiet consectetur. Curabitur sagittis eleifend arcu eget elementum. Aenean interdum tincidunt ornare. Pellentesque sit amet interdum tortor. Pellentesque blandit nisl eget euismod consequat. Etiam feugiat felis sit amet porta pulvinar. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\nNulla faucibus sem ipsum, at rhoncus diam pulvinar at. Vivamus consectetur, diam... (truncated)
Result: {"longString":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lobortis semper diam, ac euismod diam pharetra sed. Etiam eget efficitur neque. Proin nec diam mi. Sed ut purus dolor. Nulla nulla nibh, ornare vitae ornare et, scelerisque rutrum eros. Mauris venenatis tincidunt turpis a mollis. Donec gravida eget enim in luctus.\n\nSed porttitor commodo orci, ut pretium eros convallis eget. Curabitur pretium velit in odio dictum luctus. Vivamus ac tristique arcu, a semper tellus. Morbi euismod purus dapibus vestibulum sagittis. Nunc dapibus vehicula leo at scelerisque. Donec porta mauris quis nulla imperdiet consectetur. Curabitur sagittis eleifend arcu eget elementum. Aenean interdum tincidunt ornare. Pellentesque sit amet interdum tortor. Pellentesque blandit nisl eget euismod consequat. Etiam feugiat felis sit amet porta pulvinar. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\nNulla faucibus sem ipsum, at rhoncus diam pulvinar at. Vivamus consectetur, diam... (truncated) functionName=aFunction, user=CK1lvkmaLg
```
* Implement PR comments:
- add back params to metadata and add back to the test
- use screaming snake case for conts
* fix typo
* Implemented syncing afterSave/afterDelete trigger calls with REST request execution flow (Issue 2489). After this change, afterSave and afterDelete triggers CAN return a promise, which needs to be resolved inside a trigger for REST request flow to continue. If trigger doesn't return a promise, request flow continues.
* Added {} to multiline if.
* Fixed bad commit.
* Fixed problem with beforeSave triggers becoming async.
* Start DB runner from tests
* Connect GridstoreAdapter only when needed
* removes unused package
* better test errors reporting
* Adds support for __op.Delete
* Better test error reporting
* Makes sure all tests can run without crashing
* Use xdescribe to skip test suite
* Removes unused dependencies
* Let volatiles classes be created with PG on start
* Do not fail if class dont exist
* adds index.spec.js to the pg suite
* Use a new config each test to prevent side effects
* Enable EmailVerificationToken specs with pg
* Makes sure failure output is not cut
* Reduces number of ignored tests in ParseObject.spec
* Inspect reconfiguration errors
* Mark GlobalConfig is incompatible with PG
- Problem is with nested updates (param.prop = value)
* PG: Nested JSON queries and updates
- Adds support for nested json and . operator queries
- Adds debug support for PG adapter
- Adds loglevel support in helper
* Enable working specs in ParseUser
* Sets default logLevel in tests to undefined
* Adds File type support, retores purchaseValidation specs
* Adds support for updating jsonb objects
- Restores PushController tests
* Proper implementation of deleteByQuery and ORs
- Adds ParseInstallation spec to the test suite
* xit only failing tests
* Nit on ParseAPI spec
* add sorting operator
* properly bound order keys
* reverts describe_only_db behavior
* Enables passing tests
* Adds basic support for relations, upsertOneObject aliased to createObject
* progress on queries options
* Fix ACL update related problems
* Creates relation tables on class creation
* Adds Relation tests
* remove flaky tests
* use promises instead of CB
* disable flaky test
* nits
* Fixes on schema spec
- Next thing is to implemenet geopoint and files correctly
* fix failues
* Basic GeoPoint support
* Adds support for $nearSphere/$maxDistance geopoint queries
* enable passing tests
* drop tables afterEach for PG, clean up relation tables too
* Better initialization/dropTables
* test case to check beforeSave changes clobbers fetched pointer fields
Basically if beforeSave makes any changes to the object it is trying to save, the fetched pointer fields on the client gets clobbered to only pointer.
* propogate only changed fields to response.
Earlier we were returning all fields even if any changes happened in beforeSave. This causes the fetched pointer fields on the client to get clobbered to only pointers.
This fix returns only the changed fields thus avoiding pointer clobber.
* The goal of this comparision seems to be checking that the all returns the user correctly.
Also it is consistent with the hosted parse that user.username not returned from PUT request.
* Adding a test demonstrating issue #1840.
* Fixes#1840
* Adds failing test with other use case
- That test fails on parse.com as well
* Bumps parse to 1.9.0
* exclude pg db
* Exclude pg on other test
* Adds clientSDK compatibility check for forward deletion
- Mark js1.9.0 as compatible
* Strips all operations from result
- fix for #1606
* Add unique indexing
* Add unique indexing for username/email
* WIP
* Finish unique indexes
* Notes on how to upgrade to 2.3.0 safely
* index on unique-indexes: c454180 Revert "Log objects rather than JSON stringified objects (#1922)"
* reconfigure username/email tests
* Start dealing with test shittyness
* Remove tests for files that we are removing
* most tests passing
* fix failing test
* Make specific server config for tests async
* Fix more tests
* fix more tests
* Fix another test
* fix more tests
* Fix email validation
* move some stuff around
* Destroy server to ensure all connections are gone
* Fix broken cloud code
* Save callback to variable
* no need to delete non existant cloud
* undo
* Fix all tests where connections are left open after server closes.
* Fix issues caused by missing gridstore adapter
* Update guide for 2.3.0 and fix final tests
* use strict
* don't use features that won't work in node 4
* Fix syntax error
* Fix typos
* Add duplicate finding command
* Update 2.3.0.md
* Cache users by objectID, and clear cache when updated via master key
* Go back to caching by session token. Clear out cache by querying _Session when user is modified with Master Key (ew, hopefully that can be improved later)
* Fix issue with user updates from different sessions causing stale reads
* Tests aren't transpiled...
* Still not transpiled