diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5804224477..f592346946 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: branches: - '**' env: - NODE_VERSION: 14.16.1 + NODE_VERSION: 14.17.3 PARSE_SERVER_TEST_TIMEOUT: 20000 jobs: check-ci: @@ -93,39 +93,44 @@ jobs: strategy: matrix: include: + - name: MongoDB 5.0, ReplicaSet, WiredTiger + MONGODB_VERSION: 5.0.1 + MONGODB_TOPOLOGY: replicaset + MONGODB_STORAGE_ENGINE: wiredTiger + NODE_VERSION: 14.17.3 - name: MongoDB 4.4, ReplicaSet, WiredTiger - MONGODB_VERSION: 4.4.4 + MONGODB_VERSION: 4.4.7 MONGODB_TOPOLOGY: replicaset MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 14.16.1 + NODE_VERSION: 14.17.3 - name: MongoDB 4.2, ReplicaSet, WiredTiger - MONGODB_VERSION: 4.2.13 + MONGODB_VERSION: 4.2.15 MONGODB_TOPOLOGY: replicaset MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 14.16.1 + NODE_VERSION: 14.17.3 - name: MongoDB 4.0, ReplicaSet, WiredTiger - MONGODB_VERSION: 4.0.23 + MONGODB_VERSION: 4.0.25 MONGODB_TOPOLOGY: replicaset MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 14.16.1 + NODE_VERSION: 14.17.3 - name: MongoDB 4.0, Standalone, MMAPv1 - MONGODB_VERSION: 4.0.23 + MONGODB_VERSION: 4.0.25 MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: mmapv1 - NODE_VERSION: 14.16.1 + NODE_VERSION: 14.17.3 - name: Redis Cache PARSE_SERVER_TEST_CACHE: redis - MONGODB_VERSION: 4.4.4 + MONGODB_VERSION: 4.4.7 MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 14.16.1 + NODE_VERSION: 14.17.3 - name: Node 12 - MONGODB_VERSION: 4.4.4 + MONGODB_VERSION: 4.4.7 MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 12.22.1 + NODE_VERSION: 12.22.3 - name: Node 15 - MONGODB_VERSION: 4.4.4 + MONGODB_VERSION: 4.4.7 MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 15.14.0 @@ -170,12 +175,16 @@ jobs: include: - name: PostgreSQL 11, PostGIS 3.0 POSTGRES_IMAGE: postgis/postgis:11-3.0 + NODE_VERSION: 14.17.3 - name: PostgreSQL 11, PostGIS 3.1 POSTGRES_IMAGE: postgis/postgis:11-3.1 + NODE_VERSION: 14.17.3 - name: PostgreSQL 12, PostGIS 3.1 POSTGRES_IMAGE: postgis/postgis:12-3.1 + NODE_VERSION: 14.17.3 - name: PostgreSQL 13, PostGIS 3.1 POSTGRES_IMAGE: postgis/postgis:13-3.1 + NODE_VERSION: 14.17.3 fail-fast: false name: ${{ matrix.name }} timeout-minutes: 15 @@ -199,12 +208,13 @@ jobs: env: PARSE_SERVER_TEST_DB: postgres PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database + NODE_VERSION: ${{ matrix.NODE_VERSION }} steps: - uses: actions/checkout@v2 - - name: Use Node.js 10 + - name: Use Node.js ${{ matrix.NODE_VERSION }} uses: actions/setup-node@v1 with: - node-version: 10 + node-version: ${{ matrix.NODE_VERSION }} - name: Cache Node.js modules uses: actions/cache@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b6e132ee3..9c6be5a0e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,12 +95,15 @@ ___ - Removed [parse-server-simple-mailgun-adapter](https://github.com/parse-community/parse-server-simple-mailgun-adapter) dependency; to continue using the adapter it has to be explicitly installed (Manuel Trezza) [#7321](https://github.com/parse-community/parse-server/pull/7321) - Remove support for MongoDB 3.6 which has reached its End-of-Life date and PostgreSQL 10 (Manuel Trezza) [#7315](https://github.com/parse-community/parse-server/pull/7315) - Remove support for Node 10 which has reached its End-of-Life date (Manuel Trezza) [#7314](https://github.com/parse-community/parse-server/pull/7314) -- Remove S3 Files Adapter from Parse Server, instead install separately as `@parse/s3-files-adapter` (Manuel Trezza) [#?](https://github.com/parse-community/parse-server/pull/?) +- Remove S3 Files Adapter from Parse Server, instead install separately as `@parse/s3-files-adapter` (Manuel Trezza) [#7324](https://github.com/parse-community/parse-server/pull/7324) ### Notable Changes - Added Parse Server Security Check to report weak security settings (Manuel Trezza, dblythy) [#7247](https://github.com/parse-community/parse-server/issues/7247) -- EXPERIMENTAL: Added new page router with placeholder rendering and localization of custom and feature pages such as password reset and email verification (Manuel Trezza) [#6891](https://github.com/parse-community/parse-server/issues/6891) -- EXPERIMENTAL: Added custom routes to easily customize flows for password reset, email verification or build entirely new flows (Manuel Trezza) [#7231](https://github.com/parse-community/parse-server/issues/7231) -- Added Deprecation Policy to govern the introduction of braking changes in a phased pattern that is more predictable for developers (Manuel Trezza) [#7199](https://github.com/parse-community/parse-server/pull/7199) +- EXPERIMENTAL: Added new page router with placeholder rendering and localization of custom and feature pages such as password reset and email verification (Manuel Trezza) [#7128](https://github.com/parse-community/parse-server/pull/7128) +- EXPERIMENTAL: Added custom routes to easily customize flows for password reset, email verification or build entirely new flows (Manuel Trezza) [#7231](https://github.com/parse-community/parse-server/pull/7231) +- Added Deprecation Policy to govern the introduction of breaking changes in a phased pattern that is more predictable for developers (Manuel Trezza) [#7199](https://github.com/parse-community/parse-server/pull/7199) +- Add REST API endpoint `/loginAs` to create session of any user with master key; allows to impersonate another user. (GormanFletcher) [#7406](https://github.com/parse-community/parse-server/pull/7406) +- Add official support for MongoDB 5.0 (Manuel Trezza) [#7469](https://github.com/parse-community/parse-server/pull/7469) + ### Other Changes - Fix error when a not yet inserted job is updated (Antonio Davi Macedo Coelho de Castro) [#7196](https://github.com/parse-community/parse-server/pull/7196) - request.context for afterFind triggers (dblythy) [#7078](https://github.com/parse-community/parse-server/pull/7078) @@ -131,6 +134,11 @@ ___ - Add building Docker image as CI check (Manuel Trezza) [#7332](https://github.com/parse-community/parse-server/pull/7332) - Add NPM package-lock version check to CI (Manuel Trezza) [#7333](https://github.com/parse-community/parse-server/pull/7333) - Fix incorrect LiveQuery events triggered for multiple subscriptions on the same class with different events [#7341](https://github.com/parse-community/parse-server/pull/7341) +- Fix select and excludeKey queries to properly accept JSON string arrays. Also allow nested fields in exclude (Corey Baker) [#7242](https://github.com/parse-community/parse-server/pull/7242) +- Fix LiveQuery server crash when using $all query operator on a missing object key (Jason Posthuma) [#7421](https://github.com/parse-community/parse-server/pull/7421) +- Added runtime deprecation warnings (Manuel Trezza) [#7451](https://github.com/parse-community/parse-server/pull/7451) +- Add ability to pass context of an object via a header, X-Parse-Cloud-Context, for Cloud Code triggers. The header addition allows client SDK's to add context without injecting _context in the body of JSON objects (Corey Baker) [#7437](https://github.com/parse-community/parse-server/pull/7437) + ___ ## 4.5.0 [Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a761f91955..201aeecf6f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,7 +182,9 @@ If you change or remove an existing feature that would lead to a breaking change - Use a default value that falls back to existing behavior. - Add a deprecation definition in `Deprecator/Deprecations.js` that will output a deprecation warning log message on Parse Server launch, for example: > DeprecationWarning: The Parse Server option 'example' will be removed in a future release. - + +For deprecations that can only be determined ad-hoc during runtime, for example Parse Query syntax deprecations, use the `Deprecator.logRuntimeDeprecation()` method. + Deprecations become breaking changes after notifying developers through deprecation warnings for at least one entire previous major release. For example: - `4.5.0` is the current version - `4.6.0` adds a new optional feature and a deprecation warning for the existing feature diff --git a/README.md b/README.md index d52ea5c869..5bc343eef9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ - +
@@ -114,8 +114,8 @@ Parse Server is continuously tested with the most recent releases of Node.js to | Version | Latest Version | End-of-Life Date | Compatibility | |------------|----------------|------------------|--------------------| -| Node.js 12 | 12.22.1 | April 2022 | ✅ Fully compatible | -| Node.js 14 | 14.16.1 | April 2023 | ✅ Fully compatible | +| Node.js 12 | 12.22.3 | April 2022 | ✅ Fully compatible | +| Node.js 14 | 14.17.3 | April 2023 | ✅ Fully compatible | | Node.js 15 | 15.14.0 | June 2021 | ✅ Fully compatible | #### MongoDB @@ -123,9 +123,10 @@ Parse Server is continuously tested with the most recent releases of MongoDB to | Version | Latest Version | End-of-Life Date | Compatibility | |-------------|----------------|------------------|--------------------| -| MongoDB 4.0 | 4.0.23 | January 2022 | ✅ Fully compatible | -| MongoDB 4.2 | 4.2.13 | TBD | ✅ Fully compatible | -| MongoDB 4.4 | 4.4.4 | TBD | ✅ Fully compatible | +| MongoDB 4.0 | 4.0.25 | April 2022 | ✅ Fully compatible | +| MongoDB 4.2 | 4.2.15 | TBD | ✅ Fully compatible | +| MongoDB 4.4 | 4.4.7 | TBD | ✅ Fully compatible | +| MongoDB 5.0 | 5.0.1 | January 2024 | ✅ Fully compatible | #### PostgreSQL Parse Server is continuously tested with the most recent releases of PostgreSQL and PostGIS to ensure compatibility, using [PostGIS docker images](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&ordering=last_updated). We follow the [PostgreSQL support schedule](https://www.postgresql.org/support/versioning) and [PostGIS support schedule](https://www.postgis.net/eol_policy/) and only test against versions that are officially supported and have not reached their end-of-life date. Due to the extensive PostgreSQL support duration of 5 years, Parse Server drops support if a version is older than 3.5 years and a newer version has been available for at least 2.5 years. diff --git a/package-lock.json b/package-lock.json index f582e63a01..d907851cdd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,9 +68,9 @@ } }, "@apollo/protobufjs": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.0.5.tgz", - "integrity": "sha512-ZtyaBH1icCgqwIGb3zrtopV2D5Q8yxibkJzlaViM08eOhTQc7rACdYu0pfORFfhllvdMZ3aq69vifYHszY4gNA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.2.tgz", + "integrity": "sha512-vF+zxhPiLtkwxONs6YanSt1EpwpGilThpneExUN5K3tCymuxNnVq2yojTvnpRjv2QfsEIt/n7ozPIIzBLwGIDQ==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -88,24 +88,21 @@ }, "dependencies": { "@types/node": { - "version": "10.17.58", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.58.tgz", - "integrity": "sha512-Dn5RBxLohjdHFj17dVVw3rtrZAeXeWg+LQfvxDIW/fdPkSiuQk7h3frKMYtsQhtIW42wkErDcy9UMVxhGW4O7w==" + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" } } }, "@apollographql/apollo-tools": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.4.9.tgz", - "integrity": "sha512-M50pk8oo3CGTu4waGOklIX3YtTZoPfWG9K/G9WB8NpyQGA1OwYTiBFv94XqUtKElTDoFwoMXpMQd3Wy5dINvxA==", - "requires": { - "apollo-env": "^0.6.6" - } + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.1.tgz", + "integrity": "sha512-ZII+/xUFfb9ezDU2gad114+zScxVFMVlZ91f8fGApMzlS1kkqoyLnC4AJaQ1Ya/X+b63I20B4Gd+eCL8QuB4sA==" }, "@apollographql/graphql-playground-html": { - "version": "1.6.27", - "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.27.tgz", - "integrity": "sha512-tea2LweZvn6y6xFV11K0KC8ETjmm52mQrW+ezgB2O/aTQf8JGyFmMcRPFgUaQZeHbWdm8iisDC6EjOKsXu0nfw==", + "version": "1.6.29", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.29.tgz", + "integrity": "sha512-xCcXpoz52rI4ksJSdOCxeOCn2DLocxwHf9dVT/Q90Pte1LX+LY+91SFtJF3KXVHH8kEin+g1KKCQPKBjZJfWNA==", "requires": { "xss": "^1.0.8" } @@ -1453,9 +1450,9 @@ } }, "@josephg/resolvable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.0.tgz", - "integrity": "sha512-OfTtjoqB2doov5aTJxkyAMK8dXoo7CjCUQSYUEtiY34jbWduOGV7+168tmCT8COMsUEd5DMSFg/0iAOPCBTNAQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz", + "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==" }, "@napi-rs/triples": { "version": "1.0.2", @@ -1796,14 +1793,14 @@ } }, "@types/content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg==" + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-0mPF08jn9zYI0n0Q/Pnz7C4kThdSt+6LD4amsrYDDpgBfrVWa3TcCOxKX1zkGgYniGagRv8heN2cbh+CAn+uuQ==" }, "@types/cookies": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.6.tgz", - "integrity": "sha512-FK4U5Qyn7/Sc5ih233OuHO0qAkOpEcD/eG6584yEiLKizTFRny86qHLe/rej3HFQrkBuUjF4whFliAdODbVN/w==", + "version": "0.7.7", + "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.7.tgz", + "integrity": "sha512-h7BcvPUogWbKCzBR2lY4oqaZbO3jXZksexYJVFvkrFeLgbZjQkU4x8pRq6eg2MHXQhY0McQdqmmsxRWlVAHooA==", "requires": { "@types/connect": "*", "@types/express": "*", @@ -1812,12 +1809,9 @@ } }, "@types/cors": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.8.tgz", - "integrity": "sha512-fO3gf3DxU2Trcbr75O7obVndW/X5k8rJNZkLXlQWStTHhP71PkRqjwPIEI0yMnJdg9R9OasjU+Bsr+Hr1xy/0w==", - "requires": { - "@types/express": "*" - } + "version": "2.8.10", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.10.tgz", + "integrity": "sha512-C7srjHiVG3Ey1nR6d511dtDkCEjxuN9W1HWAEjGq8kpcwmNM6JJkpC0xvabM7BXTG2wDq8Eu33iH9aQKa7IvLQ==" }, "@types/express": { "version": "4.17.7", @@ -1877,9 +1871,9 @@ "dev": true }, "@types/http-errors": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-2aoSC4UUbHDj2uCsCxcG/vRMXey/m17bC7UwitVm5hn22nI8O8Y9iDpA76Orc+DWkQ4zZrOKEshCqR/jSuXAHA==" + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-e+2rjEwK6KDaNOm5Aa9wNGgyS9oSZU/4pfSMMPYNOfjvFI0WVXm29+ITRFr6aKDvvKo7uU1jV68MW4ScsfDi7Q==" }, "@types/istanbul-lib-coverage": { "version": "2.0.3", @@ -1921,9 +1915,9 @@ } }, "@types/koa": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.1.tgz", - "integrity": "sha512-Qbno7FWom9nNqu0yHZ6A0+RWt4mrYBhw3wpBAQ3+IuzGcLlfeYkzZrnMq5wsxulN2np8M4KKeUpTodsOsSad5Q==", + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.13.4.tgz", + "integrity": "sha512-dfHYMfU+z/vKtQB7NUrthdAEiSvnLebvBjwHtfFmpZmB7em2N3WVQdHgnFq+xvyVgxW5jKDmjWfLD3lw4g4uTw==", "requires": { "@types/accepts": "*", "@types/content-disposition": "*", @@ -1958,15 +1952,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==" }, - "@types/node-fetch": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz", - "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -2002,9 +1987,9 @@ } }, "@types/ws": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.1.tgz", - "integrity": "sha512-ISCK1iFnR+jYv7+jLNX0wDqesZ/5RAeY3wUx6QaphmocphU61h+b+PHjS18TF4WIPTu/MMzxIq2PHr32o2TS5Q==", + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-ijZ1vzRawI7QoWnTNL8KpHixd2b2XVb9I9HAqI3triPsh1EC0xH0Eg6w2O3TKbDCgiNNlJqfrof6j4T2I+l9vw==", "requires": { "@types/node": "*" } @@ -2340,12 +2325,12 @@ } }, "apollo-cache-control": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/apollo-cache-control/-/apollo-cache-control-0.12.0.tgz", - "integrity": "sha512-kClF5rfAm159Nboul1LxA+l58Tjz0M8L1GUknEMpZt0UHhILLAn3BfcG3ToX4TbNoR9M57kKMUcbPWLdy3Up7w==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/apollo-cache-control/-/apollo-cache-control-0.14.0.tgz", + "integrity": "sha512-qN4BCq90egQrgNnTRMUHikLZZAprf3gbm8rC5Vwmc6ZdLolQ7bFsa769Hqi6Tq/lS31KLsXBLTOsRbfPHph12w==", "requires": { - "apollo-server-env": "^3.0.0", - "apollo-server-plugin-base": "^0.11.0" + "apollo-server-env": "^3.1.0", + "apollo-server-plugin-base": "^0.13.0" } }, "apollo-cache-inmemory": { @@ -2419,32 +2404,29 @@ } }, "apollo-datasource": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-0.8.0.tgz", - "integrity": "sha512-gXgsGVLuejLc138z/2jUjPAzadDQxWbcLJyBgaQsg5BaXJNkv5uW/NjiSPk00cK51hyZrb0Xx8a+L+wPk2qIBA==", - "requires": { - "apollo-server-caching": "^0.6.0", - "apollo-server-env": "^3.0.0" - } - }, - "apollo-env": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/apollo-env/-/apollo-env-0.6.6.tgz", - "integrity": "sha512-hXI9PjJtzmD34XviBU+4sPMOxnifYrHVmxpjykqI/dUD2G3yTiuRaiQqwRwB2RCdwC1Ug/jBfoQ/NHDTnnjndQ==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-0.9.0.tgz", + "integrity": "sha512-y8H99NExU1Sk4TvcaUxTdzfq2SZo6uSj5dyh75XSQvbpH6gdAXIW9MaBcvlNC7n0cVPsidHmOcHOWxJ/pTXGjA==", "requires": { - "@types/node-fetch": "2.5.7", - "core-js": "^3.0.1", - "node-fetch": "^2.2.0", - "sha.js": "^2.4.11" + "apollo-server-caching": "^0.7.0", + "apollo-server-env": "^3.1.0" } }, "apollo-graphql": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/apollo-graphql/-/apollo-graphql-0.6.1.tgz", - "integrity": "sha512-ZRXAV+k+hboCVS+FW86FW/QgnDR7gm/xMUwJPGXEbV53OLGuQQdIT0NCYK7AzzVkCfsbb7NJ3mmEclkZY9uuxQ==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/apollo-graphql/-/apollo-graphql-0.9.3.tgz", + "integrity": "sha512-rcAl2E841Iko4kSzj4Pt3PRBitmyq1MvoEmpl04TQSpGnoVgl1E/ZXuLBYxMTSnEAm7umn2IsoY+c6Ll9U/10A==", "requires": { - "apollo-env": "^0.6.6", - "lodash.sortby": "^4.7.0" + "core-js-pure": "^3.10.2", + "lodash.sortby": "^4.7.0", + "sha.js": "^2.4.11" + }, + "dependencies": { + "core-js-pure": { + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.15.2.tgz", + "integrity": "sha512-D42L7RYh1J2grW8ttxoY1+17Y4wXZeKe7uyplAI3FkNQyI5OgBIAjUfFiTPfL1rs0qLpxaabITNbjKl1Sp82tA==" + } } }, "apollo-link": { @@ -2522,17 +2504,17 @@ } }, "apollo-reporting-protobuf": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-0.6.2.tgz", - "integrity": "sha512-WJTJxLM+MRHNUxt1RTl4zD0HrLdH44F2mDzMweBj1yHL0kSt8I1WwoiF/wiGVSpnG48LZrBegCaOJeuVbJTbtw==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-0.8.0.tgz", + "integrity": "sha512-B3XmnkH6Y458iV6OsA7AhfwvTgeZnFq9nPVjbxmLKnvfkEl8hYADtz724uPa0WeBiD7DSFcnLtqg9yGmCkBohg==", "requires": { - "@apollo/protobufjs": "^1.0.3" + "@apollo/protobufjs": "1.2.2" } }, "apollo-server-caching": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/apollo-server-caching/-/apollo-server-caching-0.6.0.tgz", - "integrity": "sha512-SfjKaccrhRzUQ8TAke9FrYppp4pZV3Rp8KCs+4Ox3kGtbco68acRPJkiYYtSVc4idR8XNAUOOVfAEZVNHdZQKQ==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/apollo-server-caching/-/apollo-server-caching-0.7.0.tgz", + "integrity": "sha512-MsVCuf/2FxuTFVhGLK13B+TZH9tBd2qkyoXKKILIiGcZ5CDUEBO14vIV63aNkMkS1xxvK2U4wBcuuNj/VH2Mkw==", "requires": { "lru-cache": "^6.0.0" }, @@ -2548,38 +2530,45 @@ } }, "apollo-server-core": { - "version": "2.23.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.23.0.tgz", - "integrity": "sha512-3/a4LPgRADc8CdT/nRh7W0CAqQv3Q4DJvakWQgKqGSqDEb/0u4IBynYjlQKuPBi4wwKdeK2Hb1wiQLl+zu4StQ==", + "version": "2.25.2", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.25.2.tgz", + "integrity": "sha512-lrohEjde2TmmDTO7FlOs8x5QQbAS0Sd3/t0TaK2TWaodfzi92QAvIsq321Mol6p6oEqmjm8POIDHW1EuJd7XMA==", "requires": { - "@apollographql/apollo-tools": "^0.4.3", + "@apollographql/apollo-tools": "^0.5.0", "@apollographql/graphql-playground-html": "1.6.27", "@apollographql/graphql-upload-8-fork": "^8.1.3", "@josephg/resolvable": "^1.0.0", "@types/ws": "^7.0.0", - "apollo-cache-control": "^0.12.0", - "apollo-datasource": "^0.8.0", - "apollo-graphql": "^0.6.0", - "apollo-reporting-protobuf": "^0.6.2", - "apollo-server-caching": "^0.6.0", - "apollo-server-env": "^3.0.0", + "apollo-cache-control": "^0.14.0", + "apollo-datasource": "^0.9.0", + "apollo-graphql": "^0.9.0", + "apollo-reporting-protobuf": "^0.8.0", + "apollo-server-caching": "^0.7.0", + "apollo-server-env": "^3.1.0", "apollo-server-errors": "^2.5.0", - "apollo-server-plugin-base": "^0.11.0", - "apollo-server-types": "^0.7.0", - "apollo-tracing": "^0.13.0", + "apollo-server-plugin-base": "^0.13.0", + "apollo-server-types": "^0.9.0", + "apollo-tracing": "^0.15.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.0.0", - "graphql-extensions": "^0.13.0", + "graphql-extensions": "^0.15.0", "graphql-tag": "^2.11.0", "graphql-tools": "^4.0.8", "loglevel": "^1.6.7", "lru-cache": "^6.0.0", "sha.js": "^2.4.11", - "subscriptions-transport-ws": "^0.9.11", - "uuid": "^8.0.0", - "ws": "^6.0.0" + "subscriptions-transport-ws": "^0.9.19", + "uuid": "^8.0.0" }, "dependencies": { + "@apollographql/graphql-playground-html": { + "version": "1.6.27", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.27.tgz", + "integrity": "sha512-tea2LweZvn6y6xFV11K0KC8ETjmm52mQrW+ezgB2O/aTQf8JGyFmMcRPFgUaQZeHbWdm8iisDC6EjOKsXu0nfw==", + "requires": { + "xss": "^1.0.8" + } + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -2588,22 +2577,31 @@ "yallist": "^4.0.0" } }, - "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "subscriptions-transport-ws": { + "version": "0.9.19", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.19.tgz", + "integrity": "sha512-dxdemxFFB0ppCLg10FTtRqH/31FNRL1y1BQv8209MK5I4CwALb7iihQg+7p65lFcIl8MHatINWBLOqpgU4Kyyw==", "requires": { - "async-limiter": "~1.0.0" + "backo2": "^1.0.2", + "eventemitter3": "^3.1.0", + "iterall": "^1.2.1", + "symbol-observable": "^1.0.4", + "ws": "^5.2.0 || ^6.0.0 || ^7.0.0" } + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" } } }, "apollo-server-env": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-3.0.0.tgz", - "integrity": "sha512-tPSN+VttnPsoQAl/SBVUpGbLA97MXG990XIwq6YUnJyAixrrsjW1xYG7RlaOqetxm80y5mBZKLrRDiiSsW/vog==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-3.1.0.tgz", + "integrity": "sha512-iGdZgEOAuVop3vb0F2J3+kaBVi4caMoxefHosxmgzAbbSpvWehB8Y1QiSyyMeouYC38XNVk5wnZl+jdGSsWsIQ==", "requires": { - "node-fetch": "^2.1.2", + "node-fetch": "^2.6.1", "util.promisify": "^1.0.0" } }, @@ -2613,33 +2611,41 @@ "integrity": "sha512-lO5oTjgiC3vlVg2RKr3RiXIIQ5pGXBFxYGGUkKDhTud3jMIhs+gel8L8zsEjKaKxkjHhCQAA/bcEfYiKkGQIvA==" }, "apollo-server-express": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.22.1.tgz", - "integrity": "sha512-yXquiXA61dfOGxkvu4GoR0325IK77mBxpTkhfvl38DqZ9gVCUrPxYGbfO2fTTifLALFENXv4tQO8WAHsMCT1Lg==", + "version": "2.25.2", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.25.2.tgz", + "integrity": "sha512-A2gF2e85vvDugPlajbhr0A14cDFDIGX0mteNOJ8P3Z3cIM0D4hwrWxJidI+SzobefDIyIHu1dynFedJVhV0euQ==", "requires": { "@apollographql/graphql-playground-html": "1.6.27", "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.0", - "@types/cors": "2.8.8", - "@types/express": "4.17.11", - "@types/express-serve-static-core": "4.17.19", + "@types/cors": "2.8.10", + "@types/express": "^4.17.12", + "@types/express-serve-static-core": "^4.17.21", "accepts": "^1.3.5", - "apollo-server-core": "^2.22.1", - "apollo-server-types": "^0.7.0", + "apollo-server-core": "^2.25.2", + "apollo-server-types": "^0.9.0", "body-parser": "^1.18.3", - "cors": "^2.8.4", + "cors": "^2.8.5", "express": "^4.17.1", "graphql-subscriptions": "^1.0.0", "graphql-tools": "^4.0.8", "parseurl": "^1.3.2", - "subscriptions-transport-ws": "^0.9.16", + "subscriptions-transport-ws": "^0.9.19", "type-is": "^1.6.16" }, "dependencies": { + "@apollographql/graphql-playground-html": { + "version": "1.6.27", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.27.tgz", + "integrity": "sha512-tea2LweZvn6y6xFV11K0KC8ETjmm52mQrW+ezgB2O/aTQf8JGyFmMcRPFgUaQZeHbWdm8iisDC6EjOKsXu0nfw==", + "requires": { + "xss": "^1.0.8" + } + }, "@types/express": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.11.tgz", - "integrity": "sha512-no+R6rW60JEc59977wIxreQVsIEOAYwgCqldrA/vkpCnbD7MqTefO97lmoBe4WE0F156bC4uLSP1XHDOySnChg==", + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -2648,42 +2654,59 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.19.tgz", - "integrity": "sha512-DJOSHzX7pCiSElWaGR8kCprwibCB/3yW6vcT8VG3P0SJjnv19gnWG/AZMfM60Xj/YJIp/YCaDHyvzsFVeniARA==", + "version": "4.17.24", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", + "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", "requires": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*" } + }, + "subscriptions-transport-ws": { + "version": "0.9.19", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.19.tgz", + "integrity": "sha512-dxdemxFFB0ppCLg10FTtRqH/31FNRL1y1BQv8209MK5I4CwALb7iihQg+7p65lFcIl8MHatINWBLOqpgU4Kyyw==", + "requires": { + "backo2": "^1.0.2", + "eventemitter3": "^3.1.0", + "iterall": "^1.2.1", + "symbol-observable": "^1.0.4", + "ws": "^5.2.0 || ^6.0.0 || ^7.0.0" + } + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" } } }, "apollo-server-plugin-base": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-0.11.0.tgz", - "integrity": "sha512-Du68x0XCyQ6EWlgoL9Z+1s8fJfXgY131QbKP7ao617StQPzwB0aGCwxBDfcMt1A75VXf4TkvV1rdUH5YeJFlhQ==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-0.13.0.tgz", + "integrity": "sha512-L3TMmq2YE6BU6I4Tmgygmd0W55L+6XfD9137k+cWEBFu50vRY4Re+d+fL5WuPkk5xSPKd/PIaqzidu5V/zz8Kg==", "requires": { - "apollo-server-types": "^0.7.0" + "apollo-server-types": "^0.9.0" } }, "apollo-server-types": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-0.7.0.tgz", - "integrity": "sha512-pJ6ri2N4xJ+e2PUUPHeCNpMDzHUagJyn0DDZGQmXDz6aoMlSd4B2KUvK81hHyHkw3wHk9clgcpfM9hKqbfZweA==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-0.9.0.tgz", + "integrity": "sha512-qk9tg4Imwpk732JJHBkhW0jzfG0nFsLqK2DY6UhvJf7jLnRePYsPxWfPiNkxni27pLE2tiNlCwoDFSeWqpZyBg==", "requires": { - "apollo-reporting-protobuf": "^0.6.2", - "apollo-server-caching": "^0.6.0", - "apollo-server-env": "^3.0.0" + "apollo-reporting-protobuf": "^0.8.0", + "apollo-server-caching": "^0.7.0", + "apollo-server-env": "^3.1.0" } }, "apollo-tracing": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/apollo-tracing/-/apollo-tracing-0.13.0.tgz", - "integrity": "sha512-28z4T+XfLQ6t696usU0nTFDxVN8BfF3o74d2p/zsT4eu1OuoyoDOEmVJqdInmVRpyTJK0tDEOjkIuDJJHZftog==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/apollo-tracing/-/apollo-tracing-0.15.0.tgz", + "integrity": "sha512-UP0fztFvaZPHDhIB/J+qGuy6hWO4If069MGC98qVs0I8FICIGu4/8ykpX3X3K6RtaQ56EDAWKykCxFv4ScxMeA==", "requires": { - "apollo-server-env": "^3.0.0", - "apollo-server-plugin-base": "^0.11.0" + "apollo-server-env": "^3.1.0", + "apollo-server-plugin-base": "^0.13.0" } }, "apollo-upload-client": { @@ -2862,11 +2885,6 @@ "dev": true, "optional": true }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, "async-retry": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.1.tgz", @@ -3180,16 +3198,30 @@ } }, "browserslist": { - "version": "4.16.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.3.tgz", - "integrity": "sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001181", - "colorette": "^1.2.1", - "electron-to-chromium": "^1.3.649", + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", "escalade": "^3.1.1", - "node-releases": "^1.1.70" + "node-releases": "^1.1.71" + }, + "dependencies": { + "caniuse-lite": { + "version": "1.0.30001228", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz", + "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.736", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.736.tgz", + "integrity": "sha512-DY8dA7gR51MSo66DqitEQoUMQ0Z+A2DSXFi7tK304bdTVqczCAfUuyQw6Wdg8hIoo5zIxkU1L24RQtUce1Ioig==", + "dev": true + } } }, "bson": { @@ -3375,12 +3407,6 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "caniuse-lite": { - "version": "1.0.30001208", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", - "integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==", - "dev": true - }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -4010,11 +4036,6 @@ "dev": true, "optional": true }, - "core-js": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.10.1.tgz", - "integrity": "sha512-pwCxEXnj27XG47mu7SXAwhLP3L5CrlvCB91ANUkIz40P27kUcvNfSdvyZJ9CLHiVoKSp+TTChMQMSKQEH/IQxA==" - }, "core-js-compat": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.1.tgz", @@ -4920,12 +4941,6 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "electron-to-chromium": { - "version": "1.3.711", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.711.tgz", - "integrity": "sha512-XbklBVCDiUeho0PZQCjC25Ha6uBwqqJeyDhPLwLwfWRAo4x+FZFsmu1pPPkXT+B4MQMQoQULfyaMltDopfeiHQ==", - "dev": true - }, "elegant-spinner": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-2.0.0.tgz", @@ -5000,9 +5015,9 @@ } }, "es-abstract": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", - "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", + "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", @@ -5012,14 +5027,14 @@ "has-symbols": "^1.0.2", "is-callable": "^1.2.3", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.2", - "is-string": "^1.0.5", - "object-inspect": "^1.9.0", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.10.3", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.0" + "unbox-primitive": "^1.0.1" } }, "es-to-primitive": { @@ -6099,9 +6114,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "follow-redirects": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", - "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==" + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" }, "for-each": { "version": "0.3.3", @@ -6460,18 +6475,18 @@ "dev": true }, "graphql": { - "version": "15.5.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.5.0.tgz", - "integrity": "sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA==" + "version": "15.5.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.5.1.tgz", + "integrity": "sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw==" }, "graphql-extensions": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/graphql-extensions/-/graphql-extensions-0.13.0.tgz", - "integrity": "sha512-Bb7E97nvfX4gtrIdZ/i5YFlqOd6MGzrw8ED+t4wQVraYje6NQ+8P8MHMOV2WZLfbW8zsNTx8NdnnlbsdH5siag==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/graphql-extensions/-/graphql-extensions-0.15.0.tgz", + "integrity": "sha512-bVddVO8YFJPwuACn+3pgmrEg6I8iBuYLuwvxiE+lcQQ7POotVZxm2rgGw0PvVYmWWf3DT7nTVDZ5ROh/ALp8mA==", "requires": { - "@apollographql/apollo-tools": "^0.4.3", - "apollo-server-env": "^3.0.0", - "apollo-server-types": "^0.7.0" + "@apollographql/apollo-tools": "^0.5.0", + "apollo-server-env": "^3.1.0", + "apollo-server-types": "^0.9.0" } }, "graphql-list-fields": { @@ -6480,19 +6495,9 @@ "integrity": "sha512-9TSAwcVA3KWw7JWYep5NCk2aw3wl1ayLtbMpmG7l26vh1FZ+gZexNPP+XJfUFyJa71UU0zcKSgtgpsrsA3Xv9Q==" }, "graphql-relay": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/graphql-relay/-/graphql-relay-0.6.0.tgz", - "integrity": "sha512-OVDi6C9/qOT542Q3KxZdXja3NrDvqzbihn1B44PH8P/c5s0Q90RyQwT6guhGqXqbYEH6zbeLJWjQqiYvcg2vVw==", - "requires": { - "prettier": "^1.16.0" - }, - "dependencies": { - "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==" - } - } + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/graphql-relay/-/graphql-relay-0.8.0.tgz", + "integrity": "sha512-NU7CkwNxPzkqpBgv76Cgycrc3wmWVA2K5Sxm9DHSSLLuQTpaSRAUsX1sf2gITf+XQpkccsv56/z0LojXTyQbUw==" }, "graphql-subscriptions": { "version": "1.2.1", @@ -6503,17 +6508,17 @@ } }, "graphql-tag": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.2.tgz", - "integrity": "sha512-7N3cvsNBl8g+FHsnt9j10aqLt1G0QPf+HCe3fbOeTUNbf7xxtUHz6wpEvk5uVIKWtO2cikoXWuI6JGqt1gEURw==", + "version": "2.12.5", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.5.tgz", + "integrity": "sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ==", "requires": { - "tslib": "^1.14.1" + "tslib": "^2.1.0" }, "dependencies": { "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } }, @@ -6892,9 +6897,9 @@ } }, "idb-keyval": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-5.0.2.tgz", - "integrity": "sha512-1DYjY/nX2U9pkTkwFoAmKcK1ZWmkNgO32Oon9tp/9+HURizxUQ4fZRxMJZs093SldP7q6dotVj03kIkiqOILyA==" + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-5.0.6.tgz", + "integrity": "sha512-6lJuVbwyo82mKSH6Wq2eHkt9LcbwHAelMIcMe0tP4p20Pod7tTxq9zf0ge2n/YDfMOpDryerfmmYyuQiaFaKOg==" }, "ieee754": { "version": "1.2.1", @@ -7108,9 +7113,9 @@ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, "is-bigint": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz", - "integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==" }, "is-binary-path": { "version": "1.0.1", @@ -7123,11 +7128,11 @@ } }, "is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", + "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", "requires": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2" } }, "is-buffer": { @@ -7174,9 +7179,9 @@ } }, "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", + "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==" }, "is-descriptor": { "version": "0.1.6", @@ -7296,9 +7301,9 @@ } }, "is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", + "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==" }, "is-obj": { "version": "1.0.1", @@ -7343,12 +7348,12 @@ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==" }, "is-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", - "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", "requires": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.2" } }, "is-regexp": { @@ -7375,16 +7380,16 @@ "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", + "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==" }, "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "requires": { - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.2" } }, "is-typedarray": { @@ -8008,9 +8013,9 @@ } }, "ldapjs": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/ldapjs/-/ldapjs-2.2.4.tgz", - "integrity": "sha512-OoeAXPNPPt4D6qva2/p6rkCIHknyYFd42Vp8JhSazBs9BbkEBmoajzj2F0ElD3vR+yAuzIVCjqh1W4uR8dfn0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ldapjs/-/ldapjs-2.3.0.tgz", + "integrity": "sha512-3Rbm3CS7vzTccpP1QnzKCEPok60L/b3BFlWU8r93P5oadCAaqCWEH9Td08crPnw4Ti20W8y0+ZKtFFNzxVu4kA==", "requires": { "abstract-logging": "^2.0.0", "asn1": "^0.2.4", @@ -9051,14 +9056,14 @@ "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" }, "mongodb": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.6.tgz", - "integrity": "sha512-WlirMiuV1UPbej5JeCMqE93JRfZ/ZzqE7nJTwP85XzjAF4rRSeq2bGCb1cjfoHLOF06+HxADaPGqT0g3SbVT1w==", + "version": "3.6.9", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.9.tgz", + "integrity": "sha512-1nSCKgSunzn/CXwgOWgbPHUWOO5OfERcuOWISmqd610jn0s8BU9K4879iJVabqgpPPbA6hO7rG48eq+fGED3Mg==", "requires": { "bl": "^2.2.1", "bson": "^1.1.4", "denque": "^1.4.1", - "optional-require": "^1.0.2", + "optional-require": "^1.0.3", "safe-buffer": "^5.1.2", "saslprep": "^1.0.0" } @@ -9341,12 +9346,6 @@ "dev": true, "optional": true }, - "nanoid": { - "version": "3.1.22", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", - "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==", - "dev": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -9448,9 +9447,9 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true }, "npm-conf": { @@ -9626,14 +9625,14 @@ } }, "object-hash": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.1.1.tgz", - "integrity": "sha512-VOJmgmS+7wvXf8CjbQmimtCnEx3IAoLxI3fp2fbWehxrWBcAQFbk+vcwb6vzR0VZv/eNCJ/27j151ZTwqW/JeQ==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", + "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==" }, "object-inspect": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", - "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==" }, "object-keys": { "version": "1.1.1", @@ -9753,9 +9752,9 @@ } }, "optional-require": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.2.tgz", - "integrity": "sha512-HZubVd6IfHsbnpdNF/ICaSAzBUEW1TievpkjY3tB4Jnk8L7+pJ3conPzUt3Mn/6OZx9uzTDOHYPGA8/AxYHBOg==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz", + "integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==" }, "optionator": { "version": "0.8.3", @@ -9981,46 +9980,51 @@ } }, "parse": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/parse/-/parse-3.1.0.tgz", - "integrity": "sha512-oUDTiH2F9sRX1a+jvLTb/sJMBea6wIv3dUK/mTDJHw1lOA+r008B6ybjYCfqPu4/2CrSt1Hfe4mJNoa4Ic4dyg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/parse/-/parse-3.3.0.tgz", + "integrity": "sha512-SQkTDupU7JQBJpYFIpO8TlQjUtjboUdkXaak57pjoC1ZVbhaiNyLsdYbrlM0B+sNYhlvcMh7zwZW48u10+zm0A==", "requires": { - "@babel/runtime": "7.12.5", - "@babel/runtime-corejs3": "7.12.5", + "@babel/runtime": "7.14.6", + "@babel/runtime-corejs3": "7.14.6", "crypto-js": "4.0.0", - "idb-keyval": "5.0.2", + "idb-keyval": "5.0.6", "react-native-crypto-js": "1.0.0", "uuid": "3.4.0", - "ws": "7.4.3", + "ws": "7.5.0", "xmlhttprequest": "1.8.0" }, "dependencies": { "@babel/runtime": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", - "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "version": "7.14.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.6.tgz", + "integrity": "sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg==", "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/runtime-corejs3": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.12.5.tgz", - "integrity": "sha512-roGr54CsTmNPPzZoCP1AmDXuBoNao7tnSA83TXTwt+UK5QVyh1DIJnrgYRPWKCF2flqZQXwa7Yr8v7VmLzF0YQ==", + "version": "7.14.6", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.6.tgz", + "integrity": "sha512-Xl8SPYtdjcMoCsIM4teyVRg7jIcgl8F2kRtoCcXuHzXswt9UxZCS6BzRo8fcnCuP6u2XtPgvyonmEPF57Kxo9Q==", "requires": { - "core-js-pure": "^3.0.0", + "core-js-pure": "^3.14.0", "regenerator-runtime": "^0.13.4" } }, + "core-js-pure": { + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.15.2.tgz", + "integrity": "sha512-D42L7RYh1J2grW8ttxoY1+17Y4wXZeKe7uyplAI3FkNQyI5OgBIAjUfFiTPfL1rs0qLpxaabITNbjKl1Sp82tA==" + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "ws": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.3.tgz", - "integrity": "sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA==" + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz", + "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw==" } } }, @@ -10117,23 +10121,23 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "pg": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.5.1.tgz", - "integrity": "sha512-9wm3yX9lCfjvA98ybCyw2pADUivyNWT/yIP4ZcDVpMN0og70BUWYEGXPCTAQdGTAqnytfRADb7NERrY1qxhIqw==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.6.0.tgz", + "integrity": "sha512-qNS9u61lqljTDFvmk/N66EeGq3n6Ujzj0FFyNMGQr6XuEv4tgNTXvJQTfJdcvGit5p5/DWPu+wj920hAJFI+QQ==", "requires": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", - "pg-connection-string": "^2.4.0", - "pg-pool": "^3.2.2", - "pg-protocol": "^1.4.0", + "pg-connection-string": "^2.5.0", + "pg-pool": "^3.3.0", + "pg-protocol": "^1.5.0", "pg-types": "^2.1.0", "pgpass": "1.x" } }, "pg-connection-string": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz", - "integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", + "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" }, "pg-int8": { "version": "1.0.1", @@ -10154,25 +10158,25 @@ } }, "pg-pool": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.2.tgz", - "integrity": "sha512-ORJoFxAlmmros8igi608iVEbQNNZlp89diFVx6yV5v+ehmpMY9sK6QgpmgoXbmkNaBAx8cOOZh9g80kJv1ooyA==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.3.0.tgz", + "integrity": "sha512-0O5huCql8/D6PIRFAlmccjphLYWC+JIzvUhSzXSpGaf+tjTZc4nn+Lr7mLXBbFJfvwbP0ywDv73EiaBsxn7zdg==" }, "pg-promise": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-10.9.2.tgz", - "integrity": "sha512-ewelfzZeSPe5sbgd5ylB6edVXqoD8AH/fqZj4wPLL0242vXtkFY3JuUqt3mfvTruOqZHhoINpoXTfmC9UXbZ7A==", + "version": "10.10.2", + "resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-10.10.2.tgz", + "integrity": "sha512-ezc5Jn2DdtYpNoDjo7v9TVQFXBEGR+tnseot8IsZ3/B4XD/CnIjyUPMfizDdbXWNO66hN8p2m8nNrcrJ8uhM/g==", "requires": { "assert-options": "0.7.0", - "pg": "8.5.1", + "pg": "8.6.0", "pg-minify": "1.6.2", "spex": "3.2.0" } }, "pg-protocol": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.4.0.tgz", - "integrity": "sha512-El+aXWcwG/8wuFICMQjM5ZSAm6OWiJicFdNYo+VY3QP+8vI4SvLIWVe51PppTzMhikUJR+PsyIFKqfdXPz/yxA==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", + "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" }, "pg-types": { "version": "2.2.0", @@ -10252,16 +10256,22 @@ "optional": true }, "postcss": { - "version": "8.2.9", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.9.tgz", - "integrity": "sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==", + "version": "8.2.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.15.tgz", + "integrity": "sha512-2zO3b26eJD/8rb106Qu2o7Qgg52ND5HPjcyQiK2B98O388h43A448LCslC0dI2P97wCAQRJsFvwTRcXxTKds+Q==", "dev": true, "requires": { "colorette": "^1.2.2", - "nanoid": "^3.1.22", + "nanoid": "^3.1.23", "source-map": "^0.6.1" }, "dependencies": { + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -10635,12 +10645,12 @@ } }, "redis": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.0.2.tgz", - "integrity": "sha512-PNhLCrjU6vKVuMOyFu7oSP296mwBkcE6lrAjruBYG5LgdSqtRBoVQIylrMyVZD/lkF24RSNNatzvYag6HRBHjQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", + "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", "requires": { - "denque": "^1.4.1", - "redis-commands": "^1.5.0", + "denque": "^1.5.0", + "redis-commands": "^1.7.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0" } @@ -11720,29 +11730,21 @@ } }, "subscriptions-transport-ws": { - "version": "0.9.18", - "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.18.tgz", - "integrity": "sha512-tztzcBTNoEbuErsVQpTN2xUNN/efAZXyCyL5m3x4t6SKrEiTL2N8SaKWBFWM4u56pL79ULif3zjyeq+oV+nOaA==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.10.0.tgz", + "integrity": "sha512-k28LhLn3abJ1mowFW+LP4QGggE0e3hrk55zXbMHyAeZkCUYtC0owepiwqMD3zX8DglQVaxnhE760pESrNSEzpg==", "requires": { "backo2": "^1.0.2", "eventemitter3": "^3.1.0", "iterall": "^1.2.1", "symbol-observable": "^1.0.4", - "ws": "^5.2.0" + "ws": "^5.2.0 || ^6.0.0 || ^7.0.0" }, "dependencies": { "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" - }, - "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", - "requires": { - "async-limiter": "~1.0.0" - } } } }, @@ -12502,9 +12504,9 @@ } }, "winston-daily-rotate-file": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-4.5.1.tgz", - "integrity": "sha512-Uv1KeBneTKFZ9R3J6SmI61vOoPEofxS+GZGEwYRPc7QFE1fpEz648eGWxLnOeo8CBrANwsd+GfK5DCd4Ab1xAQ==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-4.5.5.tgz", + "integrity": "sha512-ds0WahIjiDhKCiMXmY799pDBW+58ByqIBtUcsqr4oDoXrAI3Zn+hbgFdUxzMfqA93OG0mPLYVMiotqTgE/WeWQ==", "requires": { "file-stream-rotator": "^0.5.7", "object-hash": "^2.0.1", @@ -12623,9 +12625,9 @@ } }, "ws": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", - "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==" + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", + "integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==" }, "xmlcreate": { "version": "2.0.3", @@ -12639,9 +12641,9 @@ "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" }, "xss": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.8.tgz", - "integrity": "sha512-3MgPdaXV8rfQ/pNn16Eio6VXYPTkqwa0vc7GkiymmY/DqR1SE/7VPAAVZz1GJsJFrllMYO3RHfEaiUGjab6TNw==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.9.tgz", + "integrity": "sha512-2t7FahYnGJys6DpHLhajusId7R0Pm2yTmuL0GV9+mV0ZlaLSnb2toBmppATfg5sWIhZQGlsTLoecSzya+l4EAQ==", "requires": { "commander": "^2.20.3", "cssfilter": "0.0.10" diff --git a/package.json b/package.json index fcb03a139f..bb2ba350f2 100644 --- a/package.json +++ b/package.json @@ -19,46 +19,46 @@ ], "license": "BSD-3-Clause", "dependencies": { - "@apollographql/graphql-playground-html": "1.6.27", + "@apollographql/graphql-playground-html": "1.6.29", "@graphql-tools/links": "6.2.5", "@graphql-tools/stitch": "6.2.4", "@graphql-tools/utils": "6.2.4", "@parse/fs-files-adapter": "1.2.0", "@parse/push-adapter": "3.4.0", - "apollo-server-express": "2.22.1", + "apollo-server-express": "2.25.2", "bcryptjs": "2.4.3", "body-parser": "1.19.0", "commander": "5.1.0", "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.17.1", - "follow-redirects": "1.13.3", - "graphql": "15.5.0", + "follow-redirects": "1.14.1", + "graphql": "15.5.1", "graphql-list-fields": "2.0.2", - "graphql-relay": "0.6.0", - "graphql-tag": "2.12.2", + "graphql-relay": "0.8.0", + "graphql-tag": "2.12.5", "graphql-upload": "11.0.0", "intersect": "1.0.1", "jsonwebtoken": "8.5.1", "jwks-rsa": "1.12.3", - "ldapjs": "2.2.4", + "ldapjs": "2.3.0", "lodash": "4.17.21", "lru-cache": "5.1.1", "mime": "2.5.2", - "mongodb": "3.6.6", + "mongodb": "3.6.9", "mustache": "4.2.0", - "parse": "3.1.0", + "parse": "3.3.0", "pg-monitor": "1.4.1", - "pg-promise": "10.9.2", + "pg-promise": "10.10.2", "pluralize": "8.0.0", - "redis": "3.0.2", + "redis": "3.1.2", "semver": "7.3.4", - "subscriptions-transport-ws": "0.9.18", + "subscriptions-transport-ws": "0.10.0", "tv4": "1.3.0", "uuid": "8.3.2", "winston": "3.3.3", - "winston-daily-rotate-file": "4.5.1", - "ws": "7.4.4" + "winston-daily-rotate-file": "4.5.5", + "ws": "7.5.3" }, "devDependencies": { "@actions/core": "1.2.6", @@ -91,8 +91,8 @@ "jsdoc-babel": "0.5.0", "lint-staged": "10.2.3", "madge": "4.0.2", - "mock-mail-adapter": "file:spec/dependencies/mock-mail-adapter", "mock-files-adapter": "file:spec/dependencies/mock-files-adapter", + "mock-mail-adapter": "file:spec/dependencies/mock-mail-adapter", "mongodb-runner": "4.8.1", "mongodb-version-list": "1.0.0", "node-fetch": "2.6.1", @@ -111,15 +111,15 @@ "test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start", "test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine", "test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion", - "test:mongodb:4.0.23": "npm run test:mongodb --dbversion=4.0.23", - "test:mongodb:4.2.13": "npm run test:mongodb --dbversion=4.2.13", - "test:mongodb:4.4.4": "npm run test:mongodb --dbversion=4.4.4", + "test:mongodb:4.0.25": "npm run test:mongodb --dbversion=4.0.25", + "test:mongodb:4.2.15": "npm run test:mongodb --dbversion=4.2.15", + "test:mongodb:4.4.7": "npm run test:mongodb --dbversion=4.4.7", "posttest:mongodb": "mongodb-runner stop", - "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start", - "testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine", + "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.7} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start", + "testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.7} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine", "test": "npm run testonly", - "posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner stop", - "coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 nyc jasmine", + "posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.7} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner stop", + "coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.7} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 nyc jasmine", "start": "node ./bin/parse-server", "prettier": "prettier --write '{src,spec}/{**/*,*}.js'", "prepare": "npm run build", diff --git a/resources/ci/ciCheck.js b/resources/ci/ciCheck.js index e48e55edcd..e1d968be19 100644 --- a/resources/ci/ciCheck.js +++ b/resources/ci/ciCheck.js @@ -38,8 +38,7 @@ async function checkMongoDbVersions() { '~4.3.0', // Development release according to MongoDB support '~4.7.0', // Development release according to MongoDB support - '4.4.5', // Temporarily disabled because not yet available for download via mongodb-runner - '4.0.24', // Temporarily disabled because not yet available for download via mongodb-runner + '4.0.26', // Temporarily disabled because not yet available for download via mongodb-runner ], }).check(); } diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index c53a284273..86a7627427 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -2519,6 +2519,201 @@ describe('afterFind hooks', () => { }); }); + it('should throw error if context header is malformed', async () => { + let calledBefore = false; + let calledAfter = false; + Parse.Cloud.beforeSave('TestObject', () => { + calledBefore = true; + }); + Parse.Cloud.afterSave('TestObject', () => { + calledAfter = true; + }); + const req = request({ + method: 'POST', + url: 'http://localhost:8378/1/classes/TestObject', + headers: { + 'X-Parse-Application-Id': 'test', + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Cloud-Context': 'key', + }, + body: { + foo: 'bar', + }, + }); + try { + await req; + fail('Should have thrown error'); + } catch (e) { + expect(e).toBeDefined(); + expect(e.data.code).toEqual(Parse.Error.INVALID_JSON); + } + expect(calledBefore).toBe(false); + expect(calledAfter).toBe(false); + }); + + it('should throw error if context header is string "1"', async () => { + let calledBefore = false; + let calledAfter = false; + Parse.Cloud.beforeSave('TestObject', () => { + calledBefore = true; + }); + Parse.Cloud.afterSave('TestObject', () => { + calledAfter = true; + }); + const req = request({ + method: 'POST', + url: 'http://localhost:8378/1/classes/TestObject', + headers: { + 'X-Parse-Application-Id': 'test', + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Cloud-Context': '1', + }, + body: { + foo: 'bar', + }, + }); + try { + await req; + fail('Should have thrown error'); + } catch (e) { + expect(e).toBeDefined(); + expect(e.data.code).toEqual(Parse.Error.INVALID_JSON); + } + expect(calledBefore).toBe(false); + expect(calledAfter).toBe(false); + }); + + it('should expose context in beforeSave/afterSave via header', async () => { + let calledBefore = false; + let calledAfter = false; + Parse.Cloud.beforeSave('TestObject', req => { + expect(req.object.get('foo')).toEqual('bar'); + expect(req.context.otherKey).toBe(1); + expect(req.context.key).toBe('value'); + calledBefore = true; + }); + Parse.Cloud.afterSave('TestObject', req => { + expect(req.object.get('foo')).toEqual('bar'); + expect(req.context.otherKey).toBe(1); + expect(req.context.key).toBe('value'); + calledAfter = true; + }); + const req = request({ + method: 'POST', + url: 'http://localhost:8378/1/classes/TestObject', + headers: { + 'X-Parse-Application-Id': 'test', + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Cloud-Context': '{"key":"value","otherKey":1}', + }, + body: { + foo: 'bar', + }, + }); + await req; + expect(calledBefore).toBe(true); + expect(calledAfter).toBe(true); + }); + + it('should override header context with body context in beforeSave/afterSave', async () => { + let calledBefore = false; + let calledAfter = false; + Parse.Cloud.beforeSave('TestObject', req => { + expect(req.object.get('foo')).toEqual('bar'); + expect(req.context.otherKey).toBe(10); + expect(req.context.key).toBe('hello'); + calledBefore = true; + }); + Parse.Cloud.afterSave('TestObject', req => { + expect(req.object.get('foo')).toEqual('bar'); + expect(req.context.otherKey).toBe(10); + expect(req.context.key).toBe('hello'); + calledAfter = true; + }); + const req = request({ + method: 'POST', + url: 'http://localhost:8378/1/classes/TestObject', + headers: { + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Cloud-Context': '{"key":"value","otherKey":1}', + }, + body: { + foo: 'bar', + _ApplicationId: 'test', + _context: '{"key":"hello","otherKey":10}', + }, + }); + await req; + expect(calledBefore).toBe(true); + expect(calledAfter).toBe(true); + }); + + it('should throw error if context body is malformed', async () => { + let calledBefore = false; + let calledAfter = false; + Parse.Cloud.beforeSave('TestObject', () => { + calledBefore = true; + }); + Parse.Cloud.afterSave('TestObject', () => { + calledAfter = true; + }); + const req = request({ + method: 'POST', + url: 'http://localhost:8378/1/classes/TestObject', + headers: { + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Cloud-Context': '{"key":"value","otherKey":1}', + }, + body: { + foo: 'bar', + _ApplicationId: 'test', + _context: 'key', + }, + }); + try { + await req; + fail('Should have thrown error'); + } catch (e) { + expect(e).toBeDefined(); + expect(e.data.code).toEqual(Parse.Error.INVALID_JSON); + } + expect(calledBefore).toBe(false); + expect(calledAfter).toBe(false); + }); + + it('should throw error if context body is string "true"', async () => { + let calledBefore = false; + let calledAfter = false; + Parse.Cloud.beforeSave('TestObject', () => { + calledBefore = true; + }); + Parse.Cloud.afterSave('TestObject', () => { + calledAfter = true; + }); + const req = request({ + method: 'POST', + url: 'http://localhost:8378/1/classes/TestObject', + headers: { + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Cloud-Context': '{"key":"value","otherKey":1}', + }, + body: { + foo: 'bar', + _ApplicationId: 'test', + _context: 'true', + }, + }); + try { + await req; + fail('Should have thrown error'); + } catch (e) { + expect(e).toBeDefined(); + expect(e.data.code).toEqual(Parse.Error.INVALID_JSON); + } + expect(calledBefore).toBe(false); + expect(calledAfter).toBe(false); + }); + it('should expose context in before and afterSave', async () => { let calledBefore = false; let calledAfter = false; @@ -2804,6 +2999,26 @@ describe('afterLogin hook', () => { done(); }); + it('context options should override _context object property when saving a new object', async () => { + Parse.Cloud.beforeSave('TestObject', req => { + expect(req.context.a).toEqual('a'); + expect(req.context.hello).not.toBeDefined(); + expect(req._context).not.toBeDefined(); + expect(req.object._context).not.toBeDefined(); + expect(req.object.context).not.toBeDefined(); + }); + Parse.Cloud.afterSave('TestObject', req => { + expect(req.context.a).toEqual('a'); + expect(req.context.hello).not.toBeDefined(); + expect(req._context).not.toBeDefined(); + expect(req.object._context).not.toBeDefined(); + expect(req.object.context).not.toBeDefined(); + }); + const obj = new TestObject(); + obj.set('_context', { hello: 'world' }); + await obj.save(null, { context: { a: 'a' } }); + }); + it('should have access to context when saving a new object', async () => { Parse.Cloud.beforeSave('TestObject', req => { expect(req.context.a).toEqual('a'); diff --git a/spec/Deprecator.spec.js b/spec/Deprecator.spec.js index 7e0e28df3d..3af5d10c31 100644 --- a/spec/Deprecator.spec.js +++ b/spec/Deprecator.spec.js @@ -21,16 +21,28 @@ describe('Deprecator', () => { const logSpy = spyOn(logger, 'warn').and.callFake(() => {}); await reconfigureServer(); - expect(logSpy.calls.all()[0].args[0]).toContain(deprecations[0].optionKey); - expect(logSpy.calls.all()[0].args[0]).toContain(deprecations[0].changeNewDefault); + expect(logSpy.calls.all()[0].args[0]).toEqual( + `DeprecationWarning: The Parse Server option '${deprecations[0].optionKey}' default will change to '${deprecations[0].changeNewDefault}' in a future version.` + ); }); it('does not log deprecation for new default if option is set manually', async () => { deprecations = [{ optionKey: 'exampleKey', changeNewDefault: 'exampleNewDefault' }]; spyOn(Deprecator, '_getDeprecations').and.callFake(() => deprecations); - const logSpy = spyOn(Deprecator, '_log').and.callFake(() => {}); + const logSpy = spyOn(Deprecator, '_logOption').and.callFake(() => {}); await reconfigureServer({ [deprecations[0].optionKey]: 'manuallySet' }); expect(logSpy).not.toHaveBeenCalled(); }); + + it('logs runtime deprecation', async () => { + const logger = require('../lib/logger').logger; + const logSpy = spyOn(logger, 'warn').and.callFake(() => {}); + const options = { usage: 'Doing this', solution: 'Do that instead.' }; + + Deprecator.logRuntimeDeprecation(options); + expect(logSpy.calls.all()[0].args[0]).toEqual( + `DeprecationWarning: ${options.usage} is deprecated and will be removed in a future version. ${options.solution}` + ); + }); }); diff --git a/spec/OAuth1.spec.js b/spec/OAuth1.spec.js index 3234394c09..21ae7d9517 100644 --- a/spec/OAuth1.spec.js +++ b/spec/OAuth1.spec.js @@ -87,13 +87,17 @@ describe('OAuth', function () { done(); } - it('Should fail a GET request', done => { + it('GET request for a resource that requires OAuth should fail with invalid credentials', done => { + /* + This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. + Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates. + */ const options = { host: 'api.twitter.com', - consumer_key: 'XXXXXXXXXXXXXXXXXXXXXXXXX', - consumer_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + consumer_key: 'invalid_consumer_key', + consumer_secret: 'invalid_consumer_secret', }; - const path = '/1.1/help/configuration.json'; + const path = '/1.1/favorites/list.json'; const params = { lang: 'en' }; const oauthClient = new OAuth(options); oauthClient.get(path, params).then(function (data) { @@ -101,11 +105,15 @@ describe('OAuth', function () { }); }); - it('Should fail a POST request', done => { + it('POST request for a resource that requires OAuth should fail with invalid credentials', done => { + /* + This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. + Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates. + */ const options = { host: 'api.twitter.com', - consumer_key: 'XXXXXXXXXXXXXXXXXXXXXXXXX', - consumer_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + consumer_key: 'invalid_consumer_key', + consumer_secret: 'invalid_consumer_secret', }; const body = { lang: 'en', diff --git a/spec/ParseAPI.spec.js b/spec/ParseAPI.spec.js index 76143e0580..98f462c787 100644 --- a/spec/ParseAPI.spec.js +++ b/spec/ParseAPI.spec.js @@ -646,6 +646,28 @@ describe('miscellaneous', function () { }); }); + it_only_db('mongo')('pointer reassign on nested fields is working properly (#7391)', async () => { + const obj = new Parse.Object('GameScore'); // This object will include nested pointers + const ptr1 = new Parse.Object('GameScore'); + await ptr1.save(); // Obtain a unique id + const ptr2 = new Parse.Object('GameScore'); + await ptr2.save(); // Obtain a unique id + obj.set('data', { ptr: ptr1 }); + await obj.save(); + + obj.set('data.ptr', ptr2); + await obj.save(); + + const obj2 = await new Parse.Query('GameScore').get(obj.id); + expect(obj2.get('data').ptr.id).toBe(ptr2.id); + + const query = new Parse.Query('GameScore'); + query.equalTo('data.ptr', ptr2); + const res = await query.find(); + expect(res.length).toBe(1); + expect(res[0].get('data').ptr.id).toBe(ptr2.id); + }); + it('test afterSave get full object on create and update', function (done) { let triggerTime = 0; // Register a mock beforeSave hook diff --git a/spec/ParseLiveQuery.spec.js b/spec/ParseLiveQuery.spec.js index 43e91e03bb..65d1836c5f 100644 --- a/spec/ParseLiveQuery.spec.js +++ b/spec/ParseLiveQuery.spec.js @@ -645,6 +645,69 @@ describe('ParseLiveQuery', function () { await object.save(); }); + it('LiveQuery with ACL', async () => { + await reconfigureServer({ + liveQuery: { + classNames: ['Chat'], + }, + startLiveQueryServer: true, + verbose: false, + silent: true, + }); + const user = new Parse.User(); + user.setUsername('username'); + user.setPassword('password'); + await user.signUp(); + + const calls = { + beforeConnect(req) { + expect(req.event).toBe('connect'); + expect(req.clients).toBe(0); + expect(req.subscriptions).toBe(0); + expect(req.useMasterKey).toBe(false); + expect(req.installationId).toBeDefined(); + expect(req.client).toBeDefined(); + }, + beforeSubscribe(req) { + expect(req.op).toBe('subscribe'); + expect(req.requestId).toBe(1); + expect(req.query).toBeDefined(); + expect(req.user).toBeDefined(); + }, + afterLiveQueryEvent(req) { + expect(req.user).toBeDefined(); + expect(req.object.get('foo')).toBe('bar'); + }, + create(object) { + expect(object.get('foo')).toBe('bar'); + }, + delete(object) { + expect(object.get('foo')).toBe('bar'); + }, + }; + for (const key in calls) { + spyOn(calls, key).and.callThrough(); + } + Parse.Cloud.beforeConnect(calls.beforeConnect); + Parse.Cloud.beforeSubscribe('Chat', calls.beforeSubscribe); + Parse.Cloud.afterLiveQueryEvent('Chat', calls.afterLiveQueryEvent); + + const chatQuery = new Parse.Query('Chat'); + const subscription = await chatQuery.subscribe(); + subscription.on('create', calls.create); + subscription.on('delete', calls.delete); + const object = new Parse.Object('Chat'); + const acl = new Parse.ACL(user); + object.setACL(acl); + object.set({ foo: 'bar' }); + await object.save(); + await object.destroy(); + await new Promise(resolve => setTimeout(resolve, 200)); + for (const key in calls) { + expect(calls[key]).toHaveBeenCalled(); + } + }); + it('handle invalid websocket payload length', async done => { await reconfigureServer({ liveQuery: { diff --git a/spec/ParseQuery.spec.js b/spec/ParseQuery.spec.js index 9825fc2d95..e196280a5c 100644 --- a/spec/ParseQuery.spec.js +++ b/spec/ParseQuery.spec.js @@ -3133,78 +3133,394 @@ describe('Parse.Query testing', () => { ); }); - it('select keys query', function (done) { - const obj = new TestObject({ foo: 'baz', bar: 1 }); + it('select keys query JS SDK', async () => { + const obj = new TestObject({ foo: 'baz', bar: 1, qux: 2 }); + await obj.save(); + obj._clearServerData(); + const query1 = new Parse.Query(TestObject); + query1.select('foo'); + const result1 = await query1.first(); + ok(result1.id, 'expected object id to be set'); + ok(result1.createdAt, 'expected object createdAt to be set'); + ok(result1.updatedAt, 'expected object updatedAt to be set'); + ok(!result1.dirty(), 'expected result not to be dirty'); + strictEqual(result1.get('foo'), 'baz'); + strictEqual(result1.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result1.get('qux'), undefined, "expected 'qux' field to be unset"); + + const result2 = await result1.fetch(); + strictEqual(result2.get('foo'), 'baz'); + strictEqual(result2.get('bar'), 1); + strictEqual(result2.get('qux'), 2); + + obj._clearServerData(); + const query2 = new Parse.Query(TestObject); + query2.select(); + const result3 = await query2.first(); + ok(result3.id, 'expected object id to be set'); + ok(result3.createdAt, 'expected object createdAt to be set'); + ok(result3.updatedAt, 'expected object updatedAt to be set'); + ok(!result3.dirty(), 'expected result not to be dirty'); + strictEqual(result3.get('foo'), undefined, "expected 'foo' field to be unset"); + strictEqual(result3.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result3.get('qux'), undefined, "expected 'qux' field to be unset"); + + obj._clearServerData(); + const query3 = new Parse.Query(TestObject); + query3.select([]); + const result4 = await query3.first(); + ok(result4.id, 'expected object id to be set'); + ok(result4.createdAt, 'expected object createdAt to be set'); + ok(result4.updatedAt, 'expected object updatedAt to be set'); + ok(!result4.dirty(), 'expected result not to be dirty'); + strictEqual(result4.get('foo'), undefined, "expected 'foo' field to be unset"); + strictEqual(result4.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result4.get('qux'), undefined, "expected 'qux' field to be unset"); + + obj._clearServerData(); + const query4 = new Parse.Query(TestObject); + query4.select(['foo']); + const result5 = await query4.first(); + ok(result5.id, 'expected object id to be set'); + ok(result5.createdAt, 'expected object createdAt to be set'); + ok(result5.updatedAt, 'expected object updatedAt to be set'); + ok(!result5.dirty(), 'expected result not to be dirty'); + strictEqual(result5.get('foo'), 'baz'); + strictEqual(result5.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result5.get('qux'), undefined, "expected 'qux' field to be unset"); + + obj._clearServerData(); + const query5 = new Parse.Query(TestObject); + query5.select(['foo', 'bar']); + const result6 = await query5.first(); + ok(result6.id, 'expected object id to be set'); + ok(!result6.dirty(), 'expected result not to be dirty'); + strictEqual(result6.get('foo'), 'baz'); + strictEqual(result6.get('bar'), 1); + strictEqual(result6.get('qux'), undefined, "expected 'qux' field to be unset"); + + obj._clearServerData(); + const query6 = new Parse.Query(TestObject); + query6.select(['foo', 'bar', 'qux']); + const result7 = await query6.first(); + ok(result7.id, 'expected object id to be set'); + ok(!result7.dirty(), 'expected result not to be dirty'); + strictEqual(result7.get('foo'), 'baz'); + strictEqual(result7.get('bar'), 1); + strictEqual(result7.get('qux'), 2); + + obj._clearServerData(); + const query7 = new Parse.Query(TestObject); + query7.select('foo', 'bar'); + const result8 = await query7.first(); + ok(result8.id, 'expected object id to be set'); + ok(!result8.dirty(), 'expected result not to be dirty'); + strictEqual(result8.get('foo'), 'baz'); + strictEqual(result8.get('bar'), 1); + strictEqual(result8.get('qux'), undefined, "expected 'qux' field to be unset"); + + obj._clearServerData(); + const query8 = new Parse.Query(TestObject); + query8.select('foo', 'bar', 'qux'); + const result9 = await query8.first(); + ok(result9.id, 'expected object id to be set'); + ok(!result9.dirty(), 'expected result not to be dirty'); + strictEqual(result9.get('foo'), 'baz'); + strictEqual(result9.get('bar'), 1); + strictEqual(result9.get('qux'), 2); + }); + + it('select keys (arrays)', async () => { + const obj = new TestObject({ foo: 'baz', bar: 1, hello: 'world' }); + await obj.save(); - obj - .save() - .then(function () { - obj._clearServerData(); - const query = new Parse.Query(TestObject); - query.select('foo'); - return query.first(); - }) - .then(function (result) { - ok(result.id, 'expected object id to be set'); - ok(result.createdAt, 'expected object createdAt to be set'); - ok(result.updatedAt, 'expected object updatedAt to be set'); - ok(!result.dirty(), 'expected result not to be dirty'); - strictEqual(result.get('foo'), 'baz'); - strictEqual(result.get('bar'), undefined, "expected 'bar' field to be unset"); - return result.fetch(); - }) - .then(function (result) { - strictEqual(result.get('foo'), 'baz'); - strictEqual(result.get('bar'), 1); - }) - .then(function () { - obj._clearServerData(); - const query = new Parse.Query(TestObject); - query.select([]); - return query.first(); - }) - .then(function (result) { - ok(result.id, 'expected object id to be set'); - ok(!result.dirty(), 'expected result not to be dirty'); - strictEqual(result.get('foo'), undefined, "expected 'foo' field to be unset"); - strictEqual(result.get('bar'), undefined, "expected 'bar' field to be unset"); - }) - .then(function () { - obj._clearServerData(); - const query = new Parse.Query(TestObject); - query.select(['foo', 'bar']); - return query.first(); - }) - .then(function (result) { - ok(result.id, 'expected object id to be set'); - ok(!result.dirty(), 'expected result not to be dirty'); - strictEqual(result.get('foo'), 'baz'); - strictEqual(result.get('bar'), 1); - }) - .then(function () { - obj._clearServerData(); - const query = new Parse.Query(TestObject); - query.select('foo', 'bar'); - return query.first(); - }) - .then(function (result) { - ok(result.id, 'expected object id to be set'); - ok(!result.dirty(), 'expected result not to be dirty'); - strictEqual(result.get('foo'), 'baz'); - strictEqual(result.get('bar'), 1); - }) - .then( - function () { - done(); - }, - function (err) { - ok(false, 'other error: ' + JSON.stringify(err)); - done(); - } - ); + const response = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: 'hello', + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + expect(response.data.results[0].foo).toBeUndefined(); + expect(response.data.results[0].bar).toBeUndefined(); + expect(response.data.results[0].hello).toBe('world'); + + const response2 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: ['foo', 'hello'], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + expect(response2.data.results[0].foo).toBe('baz'); + expect(response2.data.results[0].bar).toBeUndefined(); + expect(response2.data.results[0].hello).toBe('world'); + + const response3 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: ['foo', 'bar', 'hello'], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + expect(response3.data.results[0].foo).toBe('baz'); + expect(response3.data.results[0].bar).toBe(1); + expect(response3.data.results[0].hello).toBe('world'); + + const response4 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: [''], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response4.data.results[0].objectId, 'expected objectId to be set'); + ok(response4.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response4.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response4.data.results[0].foo).toBeUndefined(); + expect(response4.data.results[0].bar).toBeUndefined(); + expect(response4.data.results[0].hello).toBeUndefined(); + + const response5 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: [], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response5.data.results[0].objectId, 'expected objectId to be set'); + ok(response5.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response5.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response5.data.results[0].foo).toBe('baz'); + expect(response5.data.results[0].bar).toBe(1); + expect(response5.data.results[0].hello).toBe('world'); + }); + + it('select keys (strings)', async () => { + const obj = new TestObject({ foo: 'baz', bar: 1, hello: 'world' }); + await obj.save(); + + const response = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: '', + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response.data.results[0].objectId, 'expected objectId to be set'); + ok(response.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response.data.results[0].foo).toBeUndefined(); + expect(response.data.results[0].bar).toBeUndefined(); + expect(response.data.results[0].hello).toBeUndefined(); + + const response2 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: '["foo", "hello"]', + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response2.data.results[0].objectId, 'expected objectId to be set'); + ok(response2.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response2.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response2.data.results[0].foo).toBe('baz'); + expect(response2.data.results[0].bar).toBeUndefined(); + expect(response2.data.results[0].hello).toBe('world'); + + const response3 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + keys: '["foo", "bar", "hello"]', + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response3.data.results[0].objectId, 'expected objectId to be set'); + ok(response3.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response3.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response3.data.results[0].foo).toBe('baz'); + expect(response3.data.results[0].bar).toBe(1); + expect(response3.data.results[0].hello).toBe('world'); }); - it('exclude keys', async () => { + it('exclude keys query JS SDK', async () => { + const obj = new TestObject({ foo: 'baz', bar: 1, qux: 2 }); + + await obj.save(); + obj._clearServerData(); + const query1 = new Parse.Query(TestObject); + query1.exclude('foo'); + const result1 = await query1.first(); + ok(result1.id, 'expected object id to be set'); + ok(result1.createdAt, 'expected object createdAt to be set'); + ok(result1.updatedAt, 'expected object updatedAt to be set'); + ok(!result1.dirty(), 'expected result not to be dirty'); + strictEqual(result1.get('foo'), undefined, "expected 'bar' field to be unset"); + strictEqual(result1.get('bar'), 1); + strictEqual(result1.get('qux'), 2); + + const result2 = await result1.fetch(); + strictEqual(result2.get('foo'), 'baz'); + strictEqual(result2.get('bar'), 1); + strictEqual(result2.get('qux'), 2); + + obj._clearServerData(); + const query2 = new Parse.Query(TestObject); + query2.exclude(); + const result3 = await query2.first(); + ok(result3.id, 'expected object id to be set'); + ok(result3.createdAt, 'expected object createdAt to be set'); + ok(result3.updatedAt, 'expected object updatedAt to be set'); + ok(!result3.dirty(), 'expected result not to be dirty'); + strictEqual(result3.get('foo'), 'baz'); + strictEqual(result3.get('bar'), 1); + strictEqual(result3.get('qux'), 2); + + obj._clearServerData(); + const query3 = new Parse.Query(TestObject); + query3.exclude([]); + const result4 = await query3.first(); + ok(result4.id, 'expected object id to be set'); + ok(result4.createdAt, 'expected object createdAt to be set'); + ok(result4.updatedAt, 'expected object updatedAt to be set'); + ok(!result4.dirty(), 'expected result not to be dirty'); + strictEqual(result4.get('foo'), 'baz'); + strictEqual(result4.get('bar'), 1); + strictEqual(result4.get('qux'), 2); + + obj._clearServerData(); + const query4 = new Parse.Query(TestObject); + query4.exclude(['foo']); + const result5 = await query4.first(); + ok(result5.id, 'expected object id to be set'); + ok(result5.createdAt, 'expected object createdAt to be set'); + ok(result5.updatedAt, 'expected object updatedAt to be set'); + ok(!result5.dirty(), 'expected result not to be dirty'); + strictEqual(result5.get('foo'), undefined, "expected 'bar' field to be unset"); + strictEqual(result5.get('bar'), 1); + strictEqual(result5.get('qux'), 2); + + obj._clearServerData(); + const query5 = new Parse.Query(TestObject); + query5.exclude(['foo', 'bar']); + const result6 = await query5.first(); + ok(result6.id, 'expected object id to be set'); + ok(!result6.dirty(), 'expected result not to be dirty'); + strictEqual(result6.get('foo'), undefined, "expected 'bar' field to be unset"); + strictEqual(result6.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result6.get('qux'), 2); + + obj._clearServerData(); + const query6 = new Parse.Query(TestObject); + query6.exclude(['foo', 'bar', 'qux']); + const result7 = await query6.first(); + ok(result7.id, 'expected object id to be set'); + ok(!result7.dirty(), 'expected result not to be dirty'); + strictEqual(result7.get('foo'), undefined, "expected 'bar' field to be unset"); + strictEqual(result7.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result7.get('qux'), undefined, "expected 'bar' field to be unset"); + + obj._clearServerData(); + const query7 = new Parse.Query(TestObject); + query7.exclude('foo'); + const result8 = await query7.first(); + ok(result8.id, 'expected object id to be set'); + ok(!result8.dirty(), 'expected result not to be dirty'); + strictEqual(result8.get('foo'), undefined, "expected 'bar' field to be unset"); + strictEqual(result8.get('bar'), 1); + strictEqual(result8.get('qux'), 2); + + obj._clearServerData(); + const query8 = new Parse.Query(TestObject); + query8.exclude('foo', 'bar'); + const result9 = await query8.first(); + ok(result9.id, 'expected object id to be set'); + ok(!result9.dirty(), 'expected result not to be dirty'); + strictEqual(result9.get('foo'), undefined, "expected 'bar' field to be unset"); + strictEqual(result9.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result9.get('qux'), 2); + + obj._clearServerData(); + const query9 = new Parse.Query(TestObject); + query9.exclude('foo', 'bar', 'qux'); + const result10 = await query9.first(); + ok(result10.id, 'expected object id to be set'); + ok(!result10.dirty(), 'expected result not to be dirty'); + strictEqual(result10.get('foo'), undefined, "expected 'bar' field to be unset"); + strictEqual(result10.get('bar'), undefined, "expected 'bar' field to be unset"); + strictEqual(result10.get('qux'), undefined, "expected 'bar' field to be unset"); + }); + + it('exclude keys (arrays)', async () => { + const obj = new TestObject({ foo: 'baz', hello: 'world' }); + await obj.save(); + + const response = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + excludeKeys: ['foo'], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response.data.results[0].objectId, 'expected objectId to be set'); + ok(response.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response.data.results[0].foo).toBeUndefined(); + expect(response.data.results[0].hello).toBe('world'); + + const response2 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + excludeKeys: ['foo', 'hello'], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response2.data.results[0].objectId, 'expected objectId to be set'); + ok(response2.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response2.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response2.data.results[0].foo).toBeUndefined(); + expect(response2.data.results[0].hello).toBeUndefined(); + + const response3 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + excludeKeys: [], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response3.data.results[0].objectId, 'expected objectId to be set'); + ok(response3.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response3.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response3.data.results[0].foo).toBe('baz'); + expect(response3.data.results[0].hello).toBe('world'); + + const response4 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + excludeKeys: [''], + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response4.data.results[0].objectId, 'expected objectId to be set'); + ok(response4.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response4.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response4.data.results[0].foo).toBe('baz'); + expect(response4.data.results[0].hello).toBe('world'); + }); + + it('exclude keys (strings)', async () => { const obj = new TestObject({ foo: 'baz', hello: 'world' }); await obj.save(); @@ -3216,8 +3532,53 @@ describe('Parse.Query testing', () => { }, headers: masterKeyHeaders, }); + ok(response.data.results[0].objectId, 'expected objectId to be set'); + ok(response.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response.data.results[0].updatedAt, 'expected object updatedAt to be set'); expect(response.data.results[0].foo).toBeUndefined(); expect(response.data.results[0].hello).toBe('world'); + + const response2 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + excludeKeys: '', + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response2.data.results[0].objectId, 'expected objectId to be set'); + ok(response2.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response2.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response2.data.results[0].foo).toBe('baz'); + expect(response2.data.results[0].hello).toBe('world'); + + const response3 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + excludeKeys: '["hello"]', + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response3.data.results[0].objectId, 'expected objectId to be set'); + ok(response3.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response3.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response3.data.results[0].foo).toBe('baz'); + expect(response3.data.results[0].hello).toBeUndefined(); + + const response4 = await request({ + url: Parse.serverURL + '/classes/TestObject', + qs: { + excludeKeys: '["foo", "hello"]', + where: JSON.stringify({ objectId: obj.id }), + }, + headers: masterKeyHeaders, + }); + ok(response4.data.results[0].objectId, 'expected objectId to be set'); + ok(response4.data.results[0].createdAt, 'expected object createdAt to be set'); + ok(response4.data.results[0].updatedAt, 'expected object updatedAt to be set'); + expect(response4.data.results[0].foo).toBeUndefined(); + expect(response4.data.results[0].hello).toBeUndefined(); }); it('exclude keys with select same key', async () => { @@ -3844,7 +4205,6 @@ describe('Parse.Query testing', () => { }) .then(function (savedFoobar) { const foobarQuery = new Parse.Query('Foobar'); - foobarQuery.include('barBaz'); foobarQuery.select(['fizz', 'barBaz.key']); foobarQuery.get(savedFoobar.id).then(function (foobarObj) { equal(foobarObj.get('fizz'), 'buzz'); @@ -3882,8 +4242,6 @@ describe('Parse.Query testing', () => { }) .then(function (savedFoobar) { const foobarQuery = new Parse.Query('Foobar'); - foobarQuery.include('barBaz'); - foobarQuery.include('barBaz.bazoo'); foobarQuery.select(['fizz', 'barBaz.key', 'barBaz.bazoo.some']); foobarQuery.get(savedFoobar.id).then(function (foobarObj) { equal(foobarObj.get('fizz'), 'buzz'); @@ -3901,6 +4259,65 @@ describe('Parse.Query testing', () => { }); }); + it('exclude nested keys', async () => { + const Foobar = new Parse.Object('Foobar'); + const BarBaz = new Parse.Object('Barbaz'); + BarBaz.set('key', 'value'); + BarBaz.set('otherKey', 'value'); + await BarBaz.save(); + + Foobar.set('foo', 'bar'); + Foobar.set('fizz', 'buzz'); + Foobar.set('barBaz', BarBaz); + const savedFoobar = await Foobar.save(); + + const foobarQuery = new Parse.Query('Foobar'); + foobarQuery.exclude(['foo', 'barBaz.otherKey']); + const foobarObj = await foobarQuery.get(savedFoobar.id); + equal(foobarObj.get('fizz'), 'buzz'); + equal(foobarObj.get('foo'), undefined); + if (foobarObj.has('barBaz')) { + equal(foobarObj.get('barBaz').get('key'), 'value'); + equal(foobarObj.get('barBaz').get('otherKey'), undefined); + } else { + fail('barBaz should be set'); + } + }); + + it('exclude nested keys 2 level', async () => { + const Foobar = new Parse.Object('Foobar'); + const BarBaz = new Parse.Object('Barbaz'); + const Bazoo = new Parse.Object('Bazoo'); + + Bazoo.set('some', 'thing'); + Bazoo.set('otherSome', 'value'); + await Bazoo.save(); + + BarBaz.set('key', 'value'); + BarBaz.set('otherKey', 'value'); + BarBaz.set('bazoo', Bazoo); + await BarBaz.save(); + + Foobar.set('foo', 'bar'); + Foobar.set('fizz', 'buzz'); + Foobar.set('barBaz', BarBaz); + const savedFoobar = await Foobar.save(); + + const foobarQuery = new Parse.Query('Foobar'); + foobarQuery.exclude(['foo', 'barBaz.otherKey', 'barBaz.bazoo.otherSome']); + const foobarObj = await foobarQuery.get(savedFoobar.id); + equal(foobarObj.get('fizz'), 'buzz'); + equal(foobarObj.get('foo'), undefined); + if (foobarObj.has('barBaz')) { + equal(foobarObj.get('barBaz').get('key'), 'value'); + equal(foobarObj.get('barBaz').get('otherKey'), undefined); + equal(foobarObj.get('barBaz').get('bazoo').get('some'), 'thing'); + equal(foobarObj.get('barBaz').get('bazoo').get('otherSome'), undefined); + } else { + fail('barBaz should be set'); + } + }); + it('include with *', async () => { const child1 = new TestObject({ foo: 'bar', name: 'ac' }); const child2 = new TestObject({ foo: 'baz', name: 'flo' }); @@ -3925,6 +4342,30 @@ describe('Parse.Query testing', () => { equal(result.child3.name, 'mo'); }); + it('include with ["*"]', async () => { + const child1 = new TestObject({ foo: 'bar', name: 'ac' }); + const child2 = new TestObject({ foo: 'baz', name: 'flo' }); + const child3 = new TestObject({ foo: 'bad', name: 'mo' }); + const parent = new Container({ child1, child2, child3 }); + await Parse.Object.saveAll([parent, child1, child2, child3]); + const options = Object.assign({}, masterKeyOptions, { + qs: { + where: JSON.stringify({ objectId: parent.id }), + include: '["*"]', + }, + }); + const resp = await request( + Object.assign({ url: Parse.serverURL + '/classes/Container' }, options) + ); + const result = resp.data.results[0]; + equal(result.child1.foo, 'bar'); + equal(result.child2.foo, 'baz'); + equal(result.child3.foo, 'bad'); + equal(result.child1.name, 'ac'); + equal(result.child2.name, 'flo'); + equal(result.child3.name, 'mo'); + }); + it('include with * overrides', async () => { const child1 = new TestObject({ foo: 'bar', name: 'ac' }); const child2 = new TestObject({ foo: 'baz', name: 'flo' }); @@ -3949,6 +4390,30 @@ describe('Parse.Query testing', () => { equal(result.child3.name, 'mo'); }); + it('include with ["*"] overrides', async () => { + const child1 = new TestObject({ foo: 'bar', name: 'ac' }); + const child2 = new TestObject({ foo: 'baz', name: 'flo' }); + const child3 = new TestObject({ foo: 'bad', name: 'mo' }); + const parent = new Container({ child1, child2, child3 }); + await Parse.Object.saveAll([parent, child1, child2, child3]); + const options = Object.assign({}, masterKeyOptions, { + qs: { + where: JSON.stringify({ objectId: parent.id }), + include: '["child2","*"]', + }, + }); + const resp = await request( + Object.assign({ url: Parse.serverURL + '/classes/Container' }, options) + ); + const result = resp.data.results[0]; + equal(result.child1.foo, 'bar'); + equal(result.child2.foo, 'baz'); + equal(result.child3.foo, 'bad'); + equal(result.child1.name, 'ac'); + equal(result.child2.name, 'flo'); + equal(result.child3.name, 'mo'); + }); + it('includeAll', done => { const child1 = new TestObject({ foo: 'bar', name: 'ac' }); const child2 = new TestObject({ foo: 'baz', name: 'flo' }); @@ -4720,19 +5185,6 @@ describe('Parse.Query testing', () => { equal(results[0].get('array').length, 105); }); - it('exclude keys (sdk query)', async done => { - const obj = new TestObject({ foo: 'baz', hello: 'world' }); - await obj.save(); - - const query = new Parse.Query('TestObject'); - query.exclude('foo'); - - const object = await query.get(obj.id); - expect(object.get('foo')).toBeUndefined(); - expect(object.get('hello')).toBe('world'); - done(); - }); - xit('todo: exclude keys with select key (sdk query get)', async done => { // there is some problem with js sdk caching diff --git a/spec/ParseUser.spec.js b/spec/ParseUser.spec.js index 91aeb4920a..d5612a343c 100644 --- a/spec/ParseUser.spec.js +++ b/spec/ParseUser.spec.js @@ -793,7 +793,7 @@ describe('Parse.User testing', () => { user.set('username', 'test'); await user.save(); - equal(Object.keys(user.attributes).length, 6); + equal(Object.keys(user.attributes).length, 5); ok(user.attributes['username']); ok(user.attributes['email']); await user.destroy(); @@ -4032,3 +4032,131 @@ describe('Security Advisory GHSA-8w3j-g983-8jh5', function () { expect(user.get('authData')).toEqual({ custom: { id: 'linkedID' } }); }); }); + +describe('login as other user', () => { + it('allows creating a session for another user with the master key', async done => { + await Parse.User.signUp('some_user', 'some_password'); + const userId = Parse.User.current().id; + await Parse.User.logOut(); + + try { + const response = await request({ + method: 'POST', + url: 'http://localhost:8378/1/loginAs', + headers: { + 'X-Parse-Application-Id': Parse.applicationId, + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Master-Key': 'test', + }, + body: { + userId, + }, + }); + + expect(response.data.sessionToken).toBeDefined(); + } catch (err) { + fail(`no request should fail: ${JSON.stringify(err)}`); + done(); + } + + const sessionsQuery = new Parse.Query(Parse.Session); + const sessionsAfterRequest = await sessionsQuery.find({ useMasterKey: true }); + expect(sessionsAfterRequest.length).toBe(1); + + done(); + }); + + it('rejects creating a session for another user if the user does not exist', async done => { + try { + await request({ + method: 'POST', + url: 'http://localhost:8378/1/loginAs', + headers: { + 'X-Parse-Application-Id': Parse.applicationId, + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Master-Key': 'test', + }, + body: { + userId: 'bogus-user', + }, + }); + + fail('Request should fail without a valid user ID'); + done(); + } catch (err) { + expect(err.data.code).toBe(Parse.Error.OBJECT_NOT_FOUND); + expect(err.data.error).toBe('user not found'); + } + + const sessionsQuery = new Parse.Query(Parse.Session); + const sessionsAfterRequest = await sessionsQuery.find({ useMasterKey: true }); + expect(sessionsAfterRequest.length).toBe(0); + + done(); + }); + + it('rejects creating a session for another user with invalid parameters', async done => { + const invalidUserIds = [undefined, null, '']; + + for (const invalidUserId of invalidUserIds) { + try { + await request({ + method: 'POST', + url: 'http://localhost:8378/1/loginAs', + headers: { + 'X-Parse-Application-Id': Parse.applicationId, + 'X-Parse-REST-API-Key': 'rest', + 'X-Parse-Master-Key': 'test', + }, + body: { + userId: invalidUserId, + }, + }); + + fail('Request should fail without a valid user ID'); + done(); + } catch (err) { + expect(err.data.code).toBe(Parse.Error.INVALID_VALUE); + expect(err.data.error).toBe('userId must not be empty, null, or undefined'); + } + + const sessionsQuery = new Parse.Query(Parse.Session); + const sessionsAfterRequest = await sessionsQuery.find({ useMasterKey: true }); + expect(sessionsAfterRequest.length).toBe(0); + } + + done(); + }); + + it('rejects creating a session for another user without the master key', async done => { + await Parse.User.signUp('some_user', 'some_password'); + const userId = Parse.User.current().id; + await Parse.User.logOut(); + + try { + await request({ + method: 'POST', + url: 'http://localhost:8378/1/loginAs', + headers: { + 'X-Parse-Application-Id': Parse.applicationId, + 'X-Parse-REST-API-Key': 'rest', + }, + body: { + userId, + }, + }); + + fail('Request should fail without the master key'); + done(); + } catch (err) { + expect(err.data.code).toBe(Parse.Error.OPERATION_FORBIDDEN); + expect(err.data.error).toBe('master key is required'); + } + + const sessionsQuery = new Parse.Query(Parse.Session); + const sessionsAfterRequest = await sessionsQuery.find({ useMasterKey: true }); + expect(sessionsAfterRequest.length).toBe(0); + + done(); + }); +}); diff --git a/spec/QueryTools.spec.js b/spec/QueryTools.spec.js index de4772a61c..7e09078dad 100644 --- a/spec/QueryTools.spec.js +++ b/spec/QueryTools.spec.js @@ -313,6 +313,16 @@ describe('matchesQuery', function () { expect(matchesQuery(player, orQuery)).toBe(true); }); + it('does not match $all query when value is missing', () => { + const player = { + id: new Id('Player', 'P1'), + name: 'Player 1', + score: 12, + }; + const q = { missing: { $all: [1, 2, 3] } }; + expect(matchesQuery(player, q)).toBe(false); + }); + it('matches an $and query', () => { const player = { id: new Id('Player', 'P1'), diff --git a/spec/SecurityCheck.spec.js b/spec/SecurityCheck.spec.js index 5f79ca2bbd..647ed909c0 100644 --- a/spec/SecurityCheck.spec.js +++ b/spec/SecurityCheck.spec.js @@ -23,14 +23,20 @@ describe('Security Check', () => { await reconfigureServer(config); } - const securityRequest = (options) => request(Object.assign({ - url: securityUrl, - headers: { - 'X-Parse-Master-Key': Parse.masterKey, - 'X-Parse-Application-Id': Parse.applicationId, - }, - followRedirects: false, - }, options)).catch(e => e); + const securityRequest = options => + request( + Object.assign( + { + url: securityUrl, + headers: { + 'X-Parse-Master-Key': Parse.masterKey, + 'X-Parse-Application-Id': Parse.applicationId, + }, + followRedirects: false, + }, + options + ) + ).catch(e => e); beforeEach(async () => { groupName = 'Example Group Name'; @@ -41,7 +47,7 @@ describe('Security Check', () => { solution: 'TestSolution', check: () => { return true; - } + }, }); checkFail = new Check({ group: 'TestGroup', @@ -50,14 +56,14 @@ describe('Security Check', () => { solution: 'TestSolution', check: () => { throw 'Fail'; - } + }, }); Group = class Group extends CheckGroup { setName() { return groupName; } setChecks() { - return [ checkSuccess, checkFail ]; + return [checkSuccess, checkFail]; } }; config = { @@ -154,7 +160,7 @@ describe('Security Check', () => { title: 'string', warning: 'string', solution: 'string', - check: () => {} + check: () => {}, }, { group: 'string', @@ -203,7 +209,9 @@ describe('Security Check', () => { title: 'string', warning: 'string', solution: 'string', - check: () => { throw 'error' }, + check: () => { + throw 'error'; + }, }); expect(check._checkState == CheckState.none); check.run(); @@ -277,7 +285,7 @@ describe('Security Check', () => { }); it('runs all checks of all groups', async () => { - const checkGroups = [ Group, Group ]; + const checkGroups = [Group, Group]; const runner = new CheckRunner({ checkGroups }); const report = await runner.run(); expect(report.report.groups[0].checks[0].state).toBe(CheckState.success); @@ -287,27 +295,27 @@ describe('Security Check', () => { }); it('reports correct default syntax version 1.0.0', async () => { - const checkGroups = [ Group ]; + const checkGroups = [Group]; const runner = new CheckRunner({ checkGroups, enableCheckLog: true }); const report = await runner.run(); expect(report).toEqual({ report: { - version: "1.0.0", - state: "fail", + version: '1.0.0', + state: 'fail', groups: [ { - name: "Example Group Name", - state: "fail", + name: 'Example Group Name', + state: 'fail', checks: [ { - title: "TestTitleSuccess", - state: "success", + title: 'TestTitleSuccess', + state: 'success', }, { - title: "TestTitleFail", - state: "fail", - warning: "TestWarning", - solution: "TestSolution", + title: 'TestTitleFail', + state: 'fail', + warning: 'TestWarning', + solution: 'TestSolution', }, ], }, @@ -319,7 +327,7 @@ describe('Security Check', () => { it('logs report', async () => { const logger = require('../lib/logger').logger; const logSpy = spyOn(logger, 'warn').and.callThrough(); - const checkGroups = [ Group ]; + const checkGroups = [Group]; const runner = new CheckRunner({ checkGroups, enableCheckLog: true }); const report = await runner.run(); const titles = report.report.groups.flatMap(group => group.checks.map(check => check.title)); diff --git a/src/Adapters/Storage/Mongo/MongoTransform.js b/src/Adapters/Storage/Mongo/MongoTransform.js index c591522479..5578077778 100644 --- a/src/Adapters/Storage/Mongo/MongoTransform.js +++ b/src/Adapters/Storage/Mongo/MongoTransform.js @@ -99,7 +99,10 @@ const transformKeyValueForUpdate = (className, restKey, restValue, parseFormatSc if ( (parseFormatSchema.fields[key] && parseFormatSchema.fields[key].type === 'Pointer') || - (!parseFormatSchema.fields[key] && restValue && restValue.__type == 'Pointer') + (!key.includes('.') && + !parseFormatSchema.fields[key] && + restValue && + restValue.__type == 'Pointer') // Do not use the _p_ prefix for pointers inside nested documents ) { key = '_p_' + key; } @@ -305,7 +308,10 @@ function transformQueryKeyValue(className, key, value, schema, count = false) { schema && schema.fields[key] && schema.fields[key].type === 'Pointer'; const field = schema && schema.fields[key]; - if (expectedTypeIsPointer || (!schema && value && value.__type === 'Pointer')) { + if ( + expectedTypeIsPointer || + (!schema && !key.includes('.') && value && value.__type === 'Pointer') + ) { key = '_p_' + key; } @@ -326,8 +332,11 @@ function transformQueryKeyValue(className, key, value, schema, count = false) { } // Handle atomic values - if (transformTopLevelAtom(value) !== CannotTransform) { - return { key, value: transformTopLevelAtom(value) }; + const transformRes = key.includes('.') + ? transformInteriorAtom(value) + : transformTopLevelAtom(value); + if (transformRes !== CannotTransform) { + return { key, value: transformRes }; } else { throw new Parse.Error( Parse.Error.INVALID_JSON, diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index b653ab4806..5d0e211ab4 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -1056,7 +1056,7 @@ export class PostgresStorageAdapter implements StorageAdapter { conn = conn || this._client; const self = this; - await conn.tx('schema-upgrade', async t => { + await conn.task('schema-upgrade', async t => { const columns = await t.map( 'SELECT column_name FROM information_schema.columns WHERE table_name = $